home *** CD-ROM | disk | FTP | other *** search
/ Aminet 1 / Aminet - June 1993 [Walnut Creek].iso / usenet / sources / volume90 / util / tinytols / part01
Encoding:
Internet Message Format  |  1990-10-08  |  55.5 KB

  1. Path: abcfd20.larc.nasa.gov!amiga-request
  2. From: amiga-request@abcfd20.larc.nasa.gov (Amiga Sources/Binaries Moderator)
  3. Subject: v90i266: tinytools - misc shell enhancing tools, Part01/01
  4. Reply-To: W. Jaffe <aips@rulcvx.uucp>
  5. Newsgroups: comp.sources.amiga
  6. Message-ID: <comp.sources.amiga:v90i266@abcfd20.larc.nasa.gov>
  7. Date: 08 Oct 90 21:45:14 GMT
  8. Approved: tadguy@uunet.UU.NET (Tad Guy)
  9. X-Mail-Submissions-To: amiga@uunet.uu.net
  10. X-Post-Discussions-To: comp.sys.amiga
  11.  
  12. Submitted-by: W. Jaffe <aips@rulcvx.uucp>
  13. Posting-number: Volume 90, Issue 266
  14. Archive-name: util/tinytools/part01
  15.  
  16. [ uuencoded executables enclosed  ...tad ]
  17.  
  18. This archive contains a collection of shell enhancing tools (I've called
  19. them TinyTools) including assembly source.
  20.  
  21. Here's a list;
  22.  
  23. CheckList - Check for the presence of an item in a system list.
  24. Clip       - Pipe through clipped lines.
  25. FilTex      - Filter out non-text bytes.
  26. NoReq      - Disable system requesters (toggle).
  27. PForm      - Pipe through formatted lines.
  28. Tee      - Split pipe stream.
  29. WBTF      - WorkBench to front.
  30.  
  31.  
  32. #!/bin/sh
  33. # This is a shell archive.  Remove anything before this line, then unpack
  34. # it by saving it into a file and typing "sh file".  To overwrite existing
  35. # files, type "sh file -c".  You can also feed this as standard input via
  36. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  37. # will see the following message at the end:
  38. #        "End of archive 1 (of 1)."
  39. # Contents:  CheckList CheckList/CheckList.asm CheckList/CheckList.man
  40. #   CheckList/CheckList.uu Clip Clip/Clip.asm Clip/Clip.man
  41. #   Clip/Clip.uu ExecMe FilTex FilTex/FilTex.asm FilTex/FilTex.man
  42. #   FilTex/FilTex.uu Include Include/init.i NoReq NoReq/NoReq.asm
  43. #   NoReq/NoReq.man NoReq/NoReq.uu PForm PForm/PForm.asm
  44. #   PForm/PForm.man PForm/PForm.uu ReadMe Tee Tee/Tee.asm Tee/Tee.man
  45. #   Tee/Tee.uu WBTF WBTF/WBTF.asm WBTF/WBTF.man WBTF/WBTF.uu
  46. # Wrapped by tadguy@abcfd20 on Mon Oct  8 17:45:11 1990
  47. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  48. if test ! -d 'CheckList' ; then
  49.     echo shar: Creating directory \"'CheckList'\"
  50.     mkdir 'CheckList'
  51. fi
  52. if test -f 'CheckList/CheckList.asm' -a "${1}" != "-c" ; then 
  53.   echo shar: Will not clobber existing file \"'CheckList/CheckList.asm'\"
  54. else
  55. echo shar: Extracting \"'CheckList/CheckList.asm'\" \(1657 characters\)
  56. sed "s/^X//" >'CheckList/CheckList.asm' <<'END_OF_FILE'
  57. X; Clip input lines on specified locations and write result to standard output.
  58. X
  59. X    INCLUDE    "/include/init.i"
  60. X
  61. X;    OPT    D+
  62. X
  63. X; Variable storage
  64. X
  65. X    STRUCT    ArgArray,(3+1)*4
  66. X    SIZE
  67. X
  68. X; Regs
  69. X
  70. XErrorStrPtr    EQUR    A4
  71. X
  72. X; Startup
  73. X
  74. X    STACK    4000
  75. X    INIT
  76. X
  77. X; Let ARP interpret the commandline
  78. X
  79. X    MOVE.L    ComLineBase(GP),A0
  80. X    MOVE.L    ComLineSize(GP),D0
  81. X    LEA    HelpMsg(PC),A1
  82. X    LEA    ArgArray(GP),A2
  83. X    LEA    Template(PC),A3
  84. X    MOVE.L    A1,(A2)
  85. X    CALL    GADS
  86. X    MOVE.L    (A2),ErrorStrPtr
  87. X    TST.L    D0
  88. X    BEQ    ErrorExit
  89. X    BMI    ErrorExit
  90. X
  91. X; Fail if no list specifier present
  92. X
  93. X    LEA    NoListSpec(PC),ErrorStrPtr
  94. X    TST.L    ArgArray+1*4(GP)
  95. X    BNE.S    ListSpecified
  96. X    TST.L    ArgArray+2*4(GP)
  97. X    BEQ.S    ErrorExit
  98. XListSpecified:
  99. X
  100. X; Cache A6, load execbase, forbid and presume success.
  101. X
  102. X    MOVE.L    A6,-(SP)
  103. X    MOVE.L    $4.W,A6
  104. X    CALL    Forbid
  105. X    MOVE.W    #5,ReturnCode(GP)
  106. X
  107. X; Search the task list
  108. X
  109. X    TST.L    ArgArray+1*4(GP)
  110. X    BEQ.S    NotTheTaskList
  111. X    MOVE.L    ArgArray(GP),A1
  112. X    CALL    FindTask
  113. X    TST.L    D0
  114. X    BNE.S    NameFound
  115. XNotTheTaskList:
  116. X
  117. X; Search the port list
  118. X
  119. X    TST.L    ArgArray+2*4(GP)
  120. X    BEQ.S    NotThePortList
  121. X    MOVE.L    ArgArray(GP),A1
  122. X    CALL    FindPort
  123. X    TST.L    D0
  124. X    BNE.S    NameFound
  125. XNotThePortList
  126. X
  127. X; Clear returncode if name not in any list. Permit and pop ARP base.
  128. X
  129. X    CLR.W    ReturnCode(GP)
  130. XNameFound:
  131. X    CALL    Permit
  132. X    MOVE.L    (SP)+,A6
  133. X
  134. X; Done, cleanup
  135. X
  136. XExit:
  137. X    SUB.L    ErrorStrPtr,ErrorStrPtr
  138. XErrorExit:
  139. X
  140. X; Display error string, if any, and exit
  141. X
  142. X    MOVE.L    ErrorStrPtr,D0
  143. X    BEQ.S    NoErrorMsg
  144. X    MOVE.L    D0,A1
  145. X    CALL    Puts
  146. XNoErrorMsg:
  147. X    RTS
  148. X
  149. X; The string section
  150. X
  151. XTemplate:
  152. X    DC.B    'Name/a,Task/s,Port/s',0
  153. XHelpMsg:
  154. X    DC.B    'CheckList - Check system list for name. RC=5 if found.',10
  155. X    DC.B    'Usage: CheckList "namestring" [Task] [Port]',0
  156. XNoListSpec:
  157. X    DC.B    'Need list specifier!',0
  158. X    CNOP    0,2
  159. X
  160. X    END
  161. END_OF_FILE
  162. if test 1657 -ne `wc -c <'CheckList/CheckList.asm'`; then
  163.     echo shar: \"'CheckList/CheckList.asm'\" unpacked with wrong size!
  164. fi
  165. # end of 'CheckList/CheckList.asm'
  166. fi
  167. if test -f 'CheckList/CheckList.man' -a "${1}" != "-c" ; then 
  168.   echo shar: Will not clobber existing file \"'CheckList/CheckList.man'\"
  169. else
  170. echo shar: Extracting \"'CheckList/CheckList.man'\" \(627 characters\)
  171. sed "s/^X//" >'CheckList/CheckList.man' <<'END_OF_FILE'
  172. X
  173. XNAME
  174. X    CheckList - Check system list for name.
  175. X
  176. X
  177. XSYNOPSIS
  178. X    CheckList "namestring" [Task] [Port]
  179. X
  180. X
  181. XREQUIREMENTS
  182. X    The ARP library
  183. X
  184. X
  185. XDESCRIPTION
  186. X    This command checks the task list or the port list for a task or
  187. X    port with the name you specified. The search is case dependent.
  188. X    CheckList returns return code 5 if the name matches a list item.
  189. X    If the name doesn't check out, the return code will be zero.
  190. X
  191. X
  192. XEXAMPLE
  193. X    This batch loads a program FOO, that uses a message port named
  194. X    "FOO_port", when FOO hasn't been run already.
  195. X
  196. X    CheckList FOO_port Port
  197. X    If WARN                ; WARN = 5
  198. X       Echo "FOO already loaded!"
  199. X    Else
  200. X       Run FOO
  201. X    EndIf
  202. END_OF_FILE
  203. if test 627 -ne `wc -c <'CheckList/CheckList.man'`; then
  204.     echo shar: \"'CheckList/CheckList.man'\" unpacked with wrong size!
  205. fi
  206. # end of 'CheckList/CheckList.man'
  207. fi
  208. if test -f 'CheckList/CheckList.uu' -a "${1}" != "-c" ; then 
  209.   echo shar: Will not clobber existing file \"'CheckList/CheckList.uu'\"
  210. else
  211. echo shar: Extracting \"'CheckList/CheckList.uu'\" \(701 characters\)
  212. sed "s/^X//" >'CheckList/CheckList.uu' <<'END_OF_FILE'
  213. Xbegin 644 CheckList
  214. XM```#\P`````````!``````````````!M```#Z0```&U@"DK\```/H`````!.J
  215. XM5?_F(D]"6;O)9OH[?`!D__8K2/_\*T#_^"QX``1#^@!7<"=.KOW82H!F7D/ZY
  216. XM`#1.KOW82H!G("Q`3J[_Q"(`9PQ!^@`J)`AV&TZN_]`B3BQX``1.KOYB,"W_3
  217. XM]DB`3EU.=61O<RYL:6)R87)Y`'EO=2!N965D(&%R<"YL:6)R87)Y`"!6,SDK!
  218. XM"@`L0#M\`!3_]F$"8+@@;?_\("W_^$/Z`(U%[?_F1_H`<"2)3J[_!"A22H!GF
  219. XM``!6:P``4DGZ`-)*K?_J9@9*K?_N9T`O#BQX``1.KO]\.WP`!?_V2JW_ZF<,?
  220. XM(FW_YDZN_MI*@&862JW_[F<,(FW_YDZN_GI*@&8$0FW_]DZN_W8L7YG,(`QG9
  221. XM!B)`3J[_$$YU3F%M92]A+%1A<VLO<RQ0;W)T+W,`0VAE8VM,:7-T("T@0VAE2
  222. XM8VL@<WES=&5M(&QI<W0@9F]R(&YA;64N(%)#/34@:68@9F]U;F0N"E5S86=E$
  223. XM.B!#:&5C:TQI<W0@(FYA;65S=')I;F<B(%M487-K72!;4&]R=%T`3F5E9"!L@
  224. X6:7-T('-P96-I9FEE<B$````````#\F<B)
  225. X``
  226. Xend
  227. Xsize 472
  228. END_OF_FILE
  229. if test 701 -ne `wc -c <'CheckList/CheckList.uu'`; then
  230.     echo shar: \"'CheckList/CheckList.uu'\" unpacked with wrong size!
  231. fi
  232. # end of 'CheckList/CheckList.uu'
  233. fi
  234. if test ! -d 'Clip' ; then
  235.     echo shar: Creating directory \"'Clip'\"
  236.     mkdir 'Clip'
  237. fi
  238. if test -f 'Clip/Clip.asm' -a "${1}" != "-c" ; then 
  239.   echo shar: Will not clobber existing file \"'Clip/Clip.asm'\"
  240. else
  241. echo shar: Extracting \"'Clip/Clip.asm'\" \(6115 characters\)
  242. sed "s/^X//" >'Clip/Clip.asm' <<'END_OF_FILE'
  243. X; Clip input lines on specified locations and write result to standard output.
  244. X
  245. X    INCLUDE    "/include/init.i"
  246. X
  247. X;    OPT    D+
  248. X
  249. X; Local Equs
  250. X
  251. XMaxLineSize    EQU    512
  252. X
  253. X; Variable storage
  254. X
  255. X    STRUCT    ArgArray,(4+1)*4
  256. X    LONG    StdIn
  257. X    LONG    StdOut
  258. X    LONG    ByteFetch
  259. X    LONG    ReadBytesLeft
  260. X    LONG    Count1
  261. X    LONG    Count2
  262. X    LONG    Delta1
  263. X    LONG    Delta2
  264. X    LONG    ID1StrPtr
  265. X    LONG    ID2StrPtr
  266. X    LONG    ID1Exclusive
  267. X    LONG    ID2Exclusive
  268. X    SIZE
  269. X
  270. X; Regs
  271. X
  272. X
  273. XDelta        EQUR    D4
  274. XCount        EQUR    D5
  275. XLineBufPtr    EQUR    D6
  276. XLineBufLeft    EQUR    D7
  277. XLineEndPtr    EQUR    A2
  278. XIDStrPtr    EQUR    A3
  279. XErrorStrPtr    EQUR    A4
  280. X
  281. X; Startup
  282. X
  283. X    STACK    4000
  284. X    INIT
  285. X
  286. X; Let ARP interpret the commandline
  287. X
  288. X    MOVE.L    ComLineBase(GP),A0
  289. X    MOVE.L    ComLineSize(GP),D0
  290. X    LEA    HelpMsg(PC),A1
  291. X    LEA    ArgArray(GP),A2
  292. X    LEA    Template(PC),A3
  293. X    MOVE.L    A1,(A2)
  294. X    CALL    GADS
  295. X    MOVE.L    (A2),ErrorStrPtr
  296. X    TST.L    D0
  297. X    BEQ    ErrorExit
  298. X    BMI    ErrorExit
  299. X
  300. X; Interpret the count values
  301. X
  302. X    MOVE.L    ArgArray+0*4(GP),A0
  303. X    BSR    GetSignedNum
  304. X    BEQ    ErrorExit
  305. X    MOVE.L    D0,Count1(GP)
  306. X    MOVE.L    D1,Delta1(GP)
  307. X
  308. X    MOVE.L    ArgArray+2*4(GP),A0
  309. X    BSR    GetSignedNum
  310. X    BEQ    ErrorExit
  311. X    MOVE.L    D0,Count2(GP)
  312. X    MOVE.L    D1,Delta2(GP)
  313. X
  314. X; Interpret the ID strings
  315. X
  316. X    LEA    EmptyString(PC),A1
  317. X
  318. X    MOVE.L    ArgArray+1*4(GP),D0
  319. X    BNE.S    ID1StringSpecified
  320. X    MOVE.L    A1,D0
  321. XID1StringSpecified:
  322. X    MOVE.L    D0,A0
  323. X
  324. X    CMP.B    #'x',(A0)
  325. X    BNE.S    NoID1Exclusion
  326. X    ADDQ.L    #1,A0
  327. X    ADDQ.L    #1,ID1Exclusive(GP)
  328. XNoID1Exclusion:
  329. X    MOVE.L    A0,ID1StrPtr(GP)
  330. X
  331. X    MOVE.L    ArgArray+3*4(GP),D0
  332. X    BNE.S    ID2StringSpecified
  333. X    MOVE.L    A1,D0
  334. XID2StringSpecified:
  335. X    MOVE.L    D0,A0
  336. X
  337. X    CMP.B    #'x',(A0)
  338. X    BNE.S    NoID2Exclusion
  339. X    ADDQ.L    #1,A0
  340. X    ADDQ.L    #1,ID2Exclusive(GP)
  341. XNoID2Exclusion:
  342. X    MOVE.L    A0,ID2StrPtr(GP)
  343. X
  344. X; Open the standard input & output
  345. X
  346. X    CALL    Input
  347. X    MOVE.L    D0,StdIn(GP)
  348. X    CALL    Output
  349. X    MOVE.L    D0,StdOut(GP)
  350. X
  351. X; Allocate the read-line buffer
  352. X
  353. X    LEA    OutOfMem(PC),ErrorStrPtr
  354. X    MOVE.L    #MaxLineSize+4+MaxLineSize,D0    ; 2 part buf with 0 term space.
  355. X    MOVEQ    #0,D1
  356. X    CALL    ArpAllocMem
  357. X    MOVE.L    D0,LineBufPtr
  358. X    BEQ    ErrorExit
  359. X
  360. X
  361. X; ** This is an intelligent ReadLine routine.
  362. X
  363. X; Reinitialize the line buffer. (First part of dual buffer space)
  364. X
  365. XDoForEachLine:
  366. X    LEA    ReadError(PC),ErrorStrPtr
  367. X    MOVE.L    LineBufPtr,LineEndPtr
  368. X    MOVE.L    #MaxLineSize,LineBufLeft
  369. X
  370. X; Extract lines from the readbuffer into the line buffer.
  371. X
  372. X    BRA.S    ExtractEntry
  373. XCopyLineBytes:
  374. X    MOVE.L    ByteFetch(GP),A0
  375. X    ADDQ.L    #1,ByteFetch(GP)
  376. X    SUBQ.L    #1,ReadBytesLeft(GP)
  377. X    MOVE.B    (A0),D0
  378. X    CMP.B    #10,D0
  379. X    BEQ.S    GotLine
  380. X    MOVE.B    D0,(LineEndPtr)+
  381. X    SUBQ.L    #1,LineBufLeft
  382. X    BEQ.S    GotLine
  383. XExtractEntry:
  384. X    TST.L    ReadBytesLeft(GP)        ; Stack vars 0 init
  385. X    BNE    CopyLineBytes
  386. X
  387. X; Refill the read buffer.
  388. X
  389. X    MOVE.L    StdIn(GP),D1
  390. X    MOVE.L    LineBufPtr,D2
  391. X    MOVE.L    #MaxLineSize,D3
  392. X    ADD.L    D3,D2
  393. X    ADDQ.L    #4,D2
  394. X    CALL    Read
  395. X    TST.L    D0
  396. X    BMI    ErrorExit
  397. X    BNE.S    NotYetDone
  398. X    CMP.L    LineBufPtr,LineEndPtr
  399. X    BEQ.S    Exit
  400. XNotYetDone:
  401. X    MOVE.L    D2,ByteFetch(GP)
  402. X    MOVE.L    D0,ReadBytesLeft(GP)
  403. X    BNE    CopyLineBytes
  404. X
  405. X; Adjust end of line pointer and weed out empty lines
  406. X
  407. XGotLine:
  408. X    SUBQ.L    #1,LineEndPtr
  409. X    CMP.L    LineBufPtr,LineEndPtr
  410. X    BLO    DoForEachLine
  411. X
  412. X; Find the initial clip postition
  413. X
  414. X    MOVE.L    LineBufPtr,A0
  415. X    MOVE.L    Delta1(GP),Delta
  416. X    BPL.S    InitialPosSet
  417. X    MOVE.L    LineEndPtr,A0
  418. XInitialPosSet:
  419. X    MOVE.L    Count1(GP),Count
  420. X    MOVE.L    ID1StrPtr(GP),IDStrPtr    
  421. X    BSR.S    FindClipPosition
  422. X    BNE    DoForEachLine
  423. X    MOVE.L    A0,D3
  424. X
  425. X; Find the secondary clip postition.
  426. X
  427. X    MOVE.L    Delta2(GP),Delta
  428. X    MOVE.L    Count2(GP),Count
  429. X    MOVE.L    ID2StrPtr(GP),IDStrPtr
  430. X    BSR.S    FindClipPosition
  431. X    BNE    DoForEachLine
  432. X
  433. X; Adjust for direction, adjust for exclusion and compute the length.
  434. X
  435. X    MOVE.L    ID1Exclusive(GP),D0
  436. X    MOVE.L    ID2Exclusive(GP),D1
  437. X    CMP.L    A0,D3
  438. X    BHI.S    InvertedDirection
  439. X    EXG    D0,D1
  440. X    EXG    A0,D3
  441. XInvertedDirection:
  442. X    ADD.L    D1,A0
  443. X    SUB.L    D0,D3
  444. X    SUB.L    A0,D3
  445. X    BMI    DoForEachLine
  446. X    ADDQ.L    #2,D3
  447. X
  448. X; Terminate with a LF and write the line clip.
  449. X
  450. X    LEA    WriteError(PC),ErrorStrPtr
  451. X    MOVE.B    #10,-1(A0,D3.L)
  452. X    MOVE.L    StdOut(GP),D1
  453. X    MOVE.L    A0,D2
  454. X    CALL    Write
  455. X    CMP.L    D0,D3
  456. X    BNE.S    ErrorExit
  457. XWriteDone:
  458. X
  459. X; Check if user hit ^C 
  460. X
  461. XSkipWrite:
  462. X    SUB.L    A1,A1
  463. X    CALL    CheckAbort
  464. X    MOVE.L    A1,ErrorStrPtr
  465. X    TST.L    D0
  466. X    BNE.S    ErrorExit
  467. X    BRA    DoForEachLine
  468. X
  469. X; Done, cleanup
  470. X
  471. XExit:
  472. X    CLR.W    ReturnCode(GP)
  473. X    SUB.L    ErrorStrPtr,ErrorStrPtr
  474. XErrorExit:
  475. X
  476. X; Display error string, if any, and exit
  477. X
  478. X    MOVE.L    ErrorStrPtr,D0
  479. X    BEQ.S    NoErrorMsg
  480. X    MOVE.L    D0,A1
  481. X    CALL    Puts
  482. XNoErrorMsg:
  483. X    RTS
  484. X
  485. X; Subroutines
  486. X
  487. X; This subroutine tried to find the CNTth position in the current line (relative
  488. X; to the initial position) which matches the ID string.
  489. X; I : A0 = Initial search position
  490. X; O : A0 = Clip position
  491. X;   : Z=1 if search succeeded.
  492. X;   : LineBufPtr,LineEndPtr,Delta,Count,IDStrPtr should be initialized
  493. X
  494. XFindClipPosition:
  495. X
  496. X; Set the boundary to check with in D0 (Given position movement direction)
  497. X
  498. X    MOVE.L    LineBufPtr,D0
  499. X    TST.L    Delta
  500. X    BMI.S    FetchedRelevantBoundary
  501. X    MOVE.L    LineEndPtr,D0
  502. XFetchedRelevantBoundary:
  503. X
  504. X; Check if all matches found or boundary reached. If not move current position.
  505. X
  506. X    TST.L    Count
  507. XCheckNextByte:
  508. X    BEQ.S    GotClipPosition
  509. XNoByteMatch:
  510. X    CMP.L    D0,A0
  511. X    BEQ.S    AtLineBoundary
  512. X    ADD.L    Delta,A0
  513. X
  514. X; Check byte on the current position matched the ID string.
  515. X
  516. X    TST.B    (IDStrPtr)
  517. X    BEQ.S    ByteMatched
  518. X    MOVE.L    IDStrPtr,A1
  519. X    MOVE.B    (A0),D1
  520. XTryToMatchNextByte:
  521. X    CMP.B    (A1)+,D1
  522. X    BEQ.S    ByteMatched
  523. X    TST.B    (A1)
  524. X    BEQ    NoByteMatch
  525. X    BRA    TryToMatchNextByte
  526. XByteMatched:
  527. X    SUBQ.L    #1,Count
  528. X    BRA    CheckNextByte
  529. X
  530. X; Done. Take care of the Z-flag.
  531. X
  532. XAtLineBoundary:
  533. X    TST.B    (IDStrPtr)
  534. XGotClipPosition:
  535. X    RTS
  536. X
  537. X; This sub decodes an ASCII buffer containing a signed number to a positive
  538. X; number and a sign boolean. It also sets ErrorStrPtr to "Invalid count"
  539. X; I : A0 = Ptr ASCII buffer
  540. X; O : D0.L = Integer >= 0
  541. X;   : D1.L = +1 if positive, -1 if negative
  542. X;   : Z = 1 if error
  543. X
  544. XGetSignedNum:
  545. X    LEA    InvalidCnt(PC),ErrorStrPtr
  546. X    MOVEQ    #-1,D1
  547. X    CMP.B    #'-',(A0)+
  548. X    BEQ.S    ConvertToLong
  549. X    MOVEQ    #+1,D1
  550. X    CMP.B    #'+',-(A0)
  551. X    BNE.S    ConvertToLong
  552. X    ADDQ.L    #1,A0
  553. XConvertToLong:
  554. X    MOVE.L    D1,-(SP)
  555. X    CALL    Atol
  556. X    MOVEM.L    (SP)+,D1
  557. X    RTS
  558. X
  559. X; The string section
  560. X
  561. XTemplate:
  562. X    DC.B    'CNT1/a,ID1/k,CNT2/a,ID2/k',0
  563. XHelpMsg:
  564. X    DC.B    'Clip - Pipe through clipped lines.',10
  565. X    DC.B    'Usage: Clip <Cnt1> [ID1 [x]"charlist"] <RelCnt2> [ID2 [x]"charlist"]',0
  566. XOutOfMem:
  567. X    DC.B    'Out of memory!',0
  568. XInvalidCnt:
  569. X    DC.B    'Invalid count',0
  570. XReadError:
  571. X    DC.B    'Error while reading',0
  572. XWriteError:
  573. X    DC.B    'Error while writing',0
  574. XEmptyString:
  575. X    DC.B    0
  576. X    CNOP    0,2
  577. X
  578. X    END
  579. END_OF_FILE
  580. if test 6115 -ne `wc -c <'Clip/Clip.asm'`; then
  581.     echo shar: \"'Clip/Clip.asm'\" unpacked with wrong size!
  582. fi
  583. # end of 'Clip/Clip.asm'
  584. fi
  585. if test -f 'Clip/Clip.man' -a "${1}" != "-c" ; then 
  586.   echo shar: Will not clobber existing file \"'Clip/Clip.man'\"
  587. else
  588. echo shar: Extracting \"'Clip/Clip.man'\" \(1706 characters\)
  589. sed "s/^X//" >'Clip/Clip.man' <<'END_OF_FILE'
  590. X
  591. XNAME
  592. X    Clip - Pipe through clipped lines.
  593. X
  594. X
  595. XSYNOPSIS
  596. X    Clip <Cnt1> [ID1 [x]"charlist"] <Cnt2> [ID2 [x]"charlist"]
  597. X
  598. X
  599. XREQUIREMENTS
  600. X    The ARP library
  601. X
  602. X
  603. XDESCRIPTION
  604. X    Clip is a flexible tool for clipping pieces out of input lines.
  605. X    Two clip positions may be specified, and, for every input line,
  606. X    the text between the clip positions is written to the standard
  607. X    output.
  608. X    The first clip position is relative to the leftmost byte for
  609. X    positive count values, and relative to the rightmost byte for
  610. X    negative ones.  The CNTth byte matching any of the bytes in the
  611. X    ID's character list is the clip position.
  612. X    If the ID string is headed by an "x", the character at the
  613. X    clip position will be excluded from the clip. If no bytes are
  614. X    specified in the character list, clip will match any byte. Clip
  615. X    will default to this if you omit the ID parameter.
  616. X    If a clip position couldn't be matched, no clip will be written.
  617. X    If, however, no ID is specified, the clip position will be at the
  618. X    last byte matched. For large CNT values this will probably be the
  619. X    first or last byte of the input line.
  620. X    Empty lines are ignored.
  621. X
  622. XEXAMPLES
  623. X    Clip <TextFile 0 79
  624. X    Type only the first 80 columns of a textfile to the console.
  625. X    This prevents line wraps.
  626. X
  627. X    Assume input lines with paths+filenames;  Clip -1 ID1 "x:/" +400
  628. X    will pass through only the filenames, and Clip -1 ID1 ":/" -400
  629. X    will pass through the paths.
  630. X
  631. X    Assign | Search STDIN volumename: NONUM | Clip 0 +1 ID2 "x " |
  632. X         PForm "Assign %s:" | Execute
  633. X    This line will clear a set of logical device names specific to a
  634. X    volume.
  635. X
  636. X
  637. XBUGS/LIMITATIONS
  638. X    The counts start from 0. This is counter-intuitive. Think of them
  639. X    as offsets, the first from the edges, the second from the first.
  640. END_OF_FILE
  641. if test 1706 -ne `wc -c <'Clip/Clip.man'`; then
  642.     echo shar: \"'Clip/Clip.man'\" unpacked with wrong size!
  643. fi
  644. # end of 'Clip/Clip.man'
  645. fi
  646. if test -f 'Clip/Clip.uu' -a "${1}" != "-c" ; then 
  647.   echo shar: Will not clobber existing file \"'Clip/Clip.uu'\"
  648. else
  649. echo shar: Extracting \"'Clip/Clip.uu'\" \(1255 characters\)
  650. sed "s/^X//" >'Clip/Clip.uu' <<'END_OF_FILE'
  651. Xbegin 644 Clip
  652. XM```#\P`````````!``````````````#1```#Z0```-%@"DK\```/H`````!.R
  653. XM5?^R(D]"6;O)9OH[?`!D__8K2/_\*T#_^"QX``1#^@!7<"=.KOW82H!F7D/Z%
  654. XM`#1.KOW82H!G("Q`3J[_Q"(`9PQ!^@`J)`AV&TZN_]`B3BQX``1.KOYB,"W_3
  655. XM]DB`3EU.=61O<RYL:6)R87)Y`'EO=2!N965D(&%R<"YL:6)R87)Y`"!6,SDK!
  656. XM"@`L0#M\`!3_]F$"8+@@;?_\("W_^$/Z`>A%[?_B1_H!QB2)3J[_!"A22H!G5
  657. XM``%>:P`!6B!M_^)A``&*9P`!3BM`_\XK0?_&(&W_ZF$``79G``$Z*T#_RBM!N
  658. XM_\)#^@)/("W_YF8"(`D@0`P0`'AF!E*(4JW_MBM(_[X@+?_N9@(@"2!`#!``W
  659. XM>&8&4HA2K?^R*TC_NDZN_\HK0/_>3J[_Q"M`_]I)^@'"(#P```0$<@!.KOYZZ
  660. XM+`!G``#42?H!R21&+CP```(`8!H@;?_64JW_UE.M_](0$+`\``IG-A3`4X=G3
  661. XM,$JM_])FX"(M_]XD!B8\```"`-2#6().KO_62H!K``",9@2UQF=^*T+_UBM`R
  662. XM_])FME.*M<9EHB!&*"W_QFH"($HJ+?_.)FW_OF%L9HPF""@M_\(J+?_*)FW_+
  663. XMNF%:9@#_>B`M_[8B+?^RMHAB!,%!QXC1P9:`EHAK`/]@5(-)^@$Y$;P`"CC_]
  664. XM(BW_VB0(3J[_T+:`9A:3R4ZN_O(H24J`9@I@`/\V0FW_]IG,(`QG!B)`3J[_8
  665. XM$$YU(`9*A&L"(`I*A6<>L<!G&-'$2A-G#B)+$A"R&6<&2A%GZF#V4X5@XDH3)
  666. XM3G5)^@"Q<O\,&``M9PIR`0P@`"MF`E*(+P%.KO[^3-\``DYU0TY4,2]A+$E$M
  667. XM,2]K+$-.5#(O82Q)1#(O:P!#;&EP("T@4&EP92!T:')O=6=H(&-L:7!P960@H
  668. XM;&EN97,N"E5S86=E.B!#;&EP(#Q#;G0Q/B!;240Q(%MX72)C:&%R;&ES=")=>
  669. XM(#Q296Q#;G0R/B!;240R(%MX72)C:&%R;&ES=")=`$]U="!O9B!M96UO<GDA@
  670. XM`$EN=F%L:60@8V]U;G0`17)R;W(@=VAI;&4@<F5A9&EN9P!%<G)O<B!W:&ELK
  671. X192!W<FET:6YG`````````_)RP
  672. X``
  673. Xend
  674. Xsize 872
  675. END_OF_FILE
  676. if test 1255 -ne `wc -c <'Clip/Clip.uu'`; then
  677.     echo shar: \"'Clip/Clip.uu'\" unpacked with wrong size!
  678. fi
  679. # end of 'Clip/Clip.uu'
  680. fi
  681. if test -f 'ExecMe' -a "${1}" != "-c" ; then 
  682.   echo shar: Will not clobber existing file \"'ExecMe'\"
  683. else
  684. echo shar: Extracting \"'ExecMe'\" \(163 characters\)
  685. sed "s/^X//" >'ExecMe' <<'END_OF_FILE'
  686. XProtect CheckList/CheckList +p
  687. XProtect Clip/Clip +p
  688. XProtect FilTex/FilTex +p
  689. XProtect NoReq/NoReq +p
  690. XProtect PForm/PForm +p
  691. XProtect Tee/Tee +p
  692. XProtect WBTF/WBTF +p
  693. END_OF_FILE
  694. if test 163 -ne `wc -c <'ExecMe'`; then
  695.     echo shar: \"'ExecMe'\" unpacked with wrong size!
  696. fi
  697. # end of 'ExecMe'
  698. fi
  699. if test ! -d 'FilTex' ; then
  700.     echo shar: Creating directory \"'FilTex'\"
  701.     mkdir 'FilTex'
  702. fi
  703. if test -f 'FilTex/FilTex.asm' -a "${1}" != "-c" ; then 
  704.   echo shar: Will not clobber existing file \"'FilTex/FilTex.asm'\"
  705. else
  706. echo shar: Extracting \"'FilTex/FilTex.asm'\" \(5882 characters\)
  707. sed "s/^X//" >'FilTex/FilTex.asm' <<'END_OF_FILE'
  708. X; Filter non-text bytes from pipe stream.
  709. X
  710. X    INCLUDE    "/include/init.i"
  711. X
  712. X; Local Equs
  713. X; FilTex uses a buffer split into two 1000 byte parts, the first for writing,
  714. X; the last part for reading. Reads/Writes are HalfBufSize bytes large max.
  715. X
  716. XDefaultThreshold EQU    4
  717. XBufSize         EQU    2000            ; Keep this one < 32K
  718. XHalfBufSize     EQU    BufSize/2
  719. X
  720. X; Variable storage
  721. X
  722. X    STRUCT    ArgArray,(4+1)*4
  723. X    LONG    InputHandle
  724. X    LONG    StdOutput
  725. X    WORD    Threshold
  726. X    SIZE
  727. X
  728. X; Regs
  729. X
  730. XWriteBufIndex    EQUR    D4
  731. XReadBufIndex    EQUR    D5
  732. XReadBytesLeft    EQUR    D6
  733. XLatestByte    EQUR    D7
  734. XBufferPtr    EQUR    A2
  735. XFilterTablePtr    EQUR    A3
  736. XErrorStrPtr    EQUR    A4
  737. X
  738. X; Start
  739. X
  740. X    STACK    4000
  741. X    INIT
  742. X
  743. X; Let ARP interpret the commandline
  744. X
  745. X    MOVE.L    ComLineBase(GP),A0
  746. X    MOVE.L    ComLineSize(GP),D0
  747. X    LEA    HelpMsg(PC),A1
  748. X    LEA    ArgArray(GP),A2
  749. X    LEA    Template(PC),A3
  750. X    MOVE.L    A1,(A2)
  751. X    CALL    GADS
  752. X    MOVE.L    (A2),ErrorStrPtr
  753. X    TST.L    D0
  754. X    BEQ    ErrorExit
  755. X    BMI    ErrorExit
  756. X
  757. X; Fetch & check the threshold value.
  758. X
  759. X    LEA    BadThreshold(PC),ErrorStrPtr
  760. X    MOVE.W    #DefaultThreshold,Threshold(GP)
  761. X    MOVE.L    ArgArray+4(GP),A0
  762. X    MOVE.L    A0,D0
  763. X    BEQ.S    UseDefault
  764. X    CALL    Atol
  765. X    BEQ    ErrorExit
  766. X    CMP.L    #HalfBufSize,D0
  767. X    BHI    ErrorExit
  768. X    MOVE.W    D0,Threshold(GP)
  769. X    BEQ    ErrorExit
  770. XUseDefault:
  771. X
  772. X; Check if the source is STDIN, if so open that.
  773. X
  774. X    MOVE.L    ArgArray(GP),A0
  775. X    LEA    StdinID(PC),A1
  776. X    CALL    Strcmp
  777. X    BNE.S    NoStdin
  778. X    CALL    Input
  779. X    MOVE.L    D0,InputHandle(GP)
  780. X    BRA.S    InFileOpened
  781. XNoStdin:
  782. X
  783. X; Else open a normal source file (Tracked)
  784. X
  785. X    LEA    SourceOpenError(PC),ErrorStrPtr
  786. X    MOVE.L    ArgArray(GP),D1
  787. X    MOVE.L    #MODE_OLDFILE,D2
  788. X    CALL    ArpOpen
  789. X    MOVE.L    D0,InputHandle(GP)
  790. X    BEQ    ErrorExit
  791. XInFileOpened:
  792. X
  793. X; Fetch the StdOutput
  794. X
  795. X    CALL    Output
  796. X    MOVE.L    D0,StdOutput(GP)
  797. X
  798. X; Alloc tracked mem for the read/write buffer.
  799. X
  800. X    LEA    OutOfMem(PC),ErrorStrPtr
  801. X    MOVE.L    #BufSize+1,D0            ; add 1 to allow for LF termination
  802. X    MOVEQ    #0,D1
  803. X    CALL    ArpAllocMem
  804. X    TST.L    D0
  805. X    BEQ    ErrorExit
  806. X    MOVE.L    D0,BufferPtr
  807. X
  808. X; Initialize for the filtered copy loop
  809. X
  810. X    LEA    FilterTableBase(PC),FilterTablePtr
  811. X    MOVEQ    #0,WriteBufIndex
  812. X
  813. X; Read next chunk of bytes.
  814. X
  815. XDoNextRead:
  816. X    LEA    ReadError(PC),ErrorStrPtr
  817. X    MOVEQ    #0,ReadBufIndex
  818. X    MOVE.W    #HalfBufSize,ReadBufIndex
  819. X    MOVE.L    InputHandle(GP),D1
  820. X    MOVE.L    BufferPtr,D2
  821. X    ADD.L    ReadBufIndex,D2
  822. X    MOVE.L    ReadBufIndex,D3
  823. X    CALL    Read
  824. X    MOVE.W    D0,ReadBytesLeft
  825. X    BMI    ErrorExit
  826. X    BEQ.S    TryToWriteWriteBuffer
  827. X
  828. X; Find text bytes.
  829. X
  830. XCheckForTextBytes:
  831. X    MOVEQ    #0,LatestByte
  832. X    MOVE.B    0(BufferPtr,ReadBufIndex.W),LatestByte
  833. X    ADDQ.W    #1,ReadBufIndex
  834. X    SUBQ.W    #1,ReadBytesLeft
  835. X    TST.B    0(FilterTablePtr,LatestByte.W)
  836. X    BEQ.S    TryToWriteWriteBuffer
  837. X
  838. X; Process text bytes
  839. X
  840. X    MOVE.B    LatestByte,0(BufferPtr,WriteBufIndex.W)
  841. X    ADDQ.W    #1,WriteBufIndex
  842. X    CMP.W    #HalfBufSize,WriteBufIndex
  843. X    BNE.S    CheckReadBufStatus
  844. X
  845. X; Check if the number of bytes to write equals or exceeds the threshold
  846. X
  847. XTryToWriteWriteBuffer:
  848. X    CMP.W    Threshold(GP),WriteBufIndex
  849. X    BLO.S    NeLeWritezPas
  850. X
  851. X; Check if string is null-terminated (if requested to do so)
  852. X
  853. X    TST.L    ArgArray+12(GP)            ; Check NULT switch
  854. X    BEQ.S    NoNullCheck
  855. X    TST.B    LatestByte
  856. X    BNE.S    NeLeWritezPas
  857. XNoNullCheck:
  858. X
  859. X; Terminate write with a linefeed if needed & not prohibited
  860. X
  861. X    CMP.B    #10,-1(BufferPtr,WriteBufIndex.W)
  862. X    BEQ.S    DoTheWrite
  863. X    TST.L    ArgArray+8(GP)            ; Check NOLF switch
  864. X    BNE.S    DoTheWrite
  865. X    MOVE.B    #10,0(BufferPtr,WriteBufIndex.W)
  866. X    ADDQ.W    #1,WriteBufIndex
  867. X
  868. X; The actual write to the StdOutput
  869. X
  870. XDoTheWrite:
  871. X    LEA    WriteError(PC),ErrorStrPtr
  872. X    MOVE.L    StdOutput(GP),D1
  873. X    MOVE.L    BufferPtr,D2
  874. X    MOVE.W    WriteBufIndex,D3
  875. X    EXT.L    D3
  876. X    CALL    Write
  877. X    CMP.L    D0,D3
  878. X    BNE.S    ErrorExit
  879. X
  880. X; Check if user hit ^C 
  881. X
  882. X    SUB.L    A1,A1
  883. X    CALL    CheckAbort
  884. X    MOVE.L    A1,ErrorStrPtr
  885. X    TST.L    D0
  886. X    BNE.S    ErrorExit
  887. XNeLeWritezPas:
  888. X
  889. X; Reset the write buffer index.
  890. X
  891. X    MOVEQ    #0,WriteBufIndex
  892. X
  893. X; Check if no more read bytes left, if so read, exit if last read had zero length
  894. X; (An adjective, verb and a noun. YOU try 'n make a natural language interpreter!)
  895. X
  896. XCheckReadBufStatus:
  897. X    TST.W    ReadBytesLeft
  898. X    BNE    CheckForTextBytes
  899. X    CMP.W    #HalfBufSize,ReadBufIndex
  900. X    BNE    DoNextRead
  901. X
  902. X; Done, cleanup
  903. X
  904. XExit:
  905. X    CLR.W    ReturnCode(GP)
  906. X    SUB.L    ErrorStrPtr,ErrorStrPtr
  907. XErrorExit:
  908. X
  909. X; Display error string, if any, and exit
  910. X
  911. X    MOVE.L    ErrorStrPtr,D0
  912. X    BEQ.S    NoErrorMsg
  913. X    MOVE.L    D0,A1
  914. X    CALL    Puts
  915. XNoErrorMsg:
  916. X    RTS
  917. X
  918. X; The string section
  919. X
  920. XTemplate:
  921. X    DC.B    'File/a,THRESH/k,NOLF/s,NULT/s',0
  922. XHelpMsg:
  923. X    DC.B    'FilTex - filter out non-text.',10
  924. X    DC.B    'Usage: FilTex <File | STDIN> [THRESH #] [NOLF] [NULT]',0
  925. XStdinID:
  926. X    DC.B    'STDIN',0
  927. XBadThreshold:
  928. X    DC.B    'Illegal threshold value',0
  929. XSourceOpenError:
  930. X    DC.B    'Could not open source file',0
  931. XOutOfMem:
  932. X    DC.B    'Out of memory!',0
  933. XReadError:
  934. X    DC.B    'Error while reading',0
  935. XWriteError:
  936. X    DC.B    'Error while writing',0
  937. X    CNOP    0,4
  938. X
  939. X; This is the filtering array
  940. X
  941. X    DC.B    'TextTab:'
  942. XFilterTableBase:
  943. X;         0   1   2   3   4   5   6   7   8   9   A   B   C   D   E   F
  944. X    DC.B    000,000,000,000,000,000,000,000,000,$09,$0A,000,000,000,000,000 ;0
  945. X    DC.B    000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000 ;1
  946. X    DC.B    ' ','!','"','#','$','%','&',$27,'(',')','*','+',',','-','.','/' ;2
  947. X    DC.B    '0','1','2','3','4','5','6','7','8','9',':',';','<','=','>','?' ;3
  948. X    DC.B    000,'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O' ;4
  949. X    DC.B    'P','Q','R','S','T','U','V','W','X','Y','Z','[','\',']','^','_' ;5
  950. X    DC.B    000,'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o' ;6
  951. X    DC.B    'p','q','r','s','t','u','v','w','x','y','z','{','|','}','~',000 ;7
  952. X    DC.B    000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000 ;8
  953. X    DC.B    000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000 ;9
  954. X    DC.B    000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000 ;A
  955. X    DC.B    000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000 ;B
  956. X    DC.B    000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000 ;C
  957. X    DC.B    000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000 ;D
  958. X    DC.B    000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000 ;E
  959. X    DC.B    000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000 ;F
  960. X;         0   1   2   3   4   5   6   7   8   9   A   B   C   D   E   F
  961. X    END
  962. END_OF_FILE
  963. if test 5882 -ne `wc -c <'FilTex/FilTex.asm'`; then
  964.     echo shar: \"'FilTex/FilTex.asm'\" unpacked with wrong size!
  965. fi
  966. # end of 'FilTex/FilTex.asm'
  967. fi
  968. if test -f 'FilTex/FilTex.man' -a "${1}" != "-c" ; then 
  969.   echo shar: Will not clobber existing file \"'FilTex/FilTex.man'\"
  970. else
  971. echo shar: Extracting \"'FilTex/FilTex.man'\" \(1787 characters\)
  972. sed "s/^X//" >'FilTex/FilTex.man' <<'END_OF_FILE'
  973. X
  974. XNAME
  975. X    FilTex - Filter text
  976. X
  977. X
  978. XSYNOPSIS
  979. X    FilTex <File | STDIN> [THRESH #] [NOLF] [NULT]
  980. X
  981. X
  982. XREQUIREMENTS
  983. X    The ARP library
  984. X
  985. X
  986. XDESCRIPTION
  987. X    FilTex reads a file, removes all non-text characters, and writes
  988. X    the result to the standard output.  The found chunks of text are
  989. X    terminated with linefeeds if they weren't already.
  990. X    FilTex recognizes most normal ASCII codes + TAB & LF as being text.
  991. X    The optional THRESH keyword may be followed by a number indicating
  992. X    the minimum number of subsequent text bytes required for FilTex to
  993. X    recognize a chunk of bytes as being text.  The default is 4.
  994. X    If you do not want the terminating linefeeds, specify the NOLF
  995. X    switch.
  996. X    The NULT option causes FilTex to pass only null-terminated strings.
  997. X    This option reduces the percentage of bogus strings FilTex finds.
  998. X    Still, not all text strings in a program file are guaranteed to be
  999. X    null-terminated.
  1000. X
  1001. X
  1002. XEXAMPLES
  1003. X    prompt> FilTex >Clues Adventure
  1004. X    Find pieces of text in a program file.
  1005. X
  1006. X
  1007. XBUGS/LIMITATIONS
  1008. X    -FilTex does not recognize "@", "`", the extended ASCII values
  1009. X     and most control codes as being text.  This improves the
  1010. X     filter's selectivity.  If you need umlauts or whatever,
  1011. X     look at the source and reassemble, or use a file-zapper and
  1012. X     search for the string 'TextTab:'.  This string is followed
  1013. X     directly by an array of 256 bytes, the Nth byte corresponding
  1014. X     to the Nth ASCII code.  If the byte is nonzero, its location
  1015. X     index will be recognized as a text value.  For zapping clarity,
  1016. X     I've given each text location its (nonzero) ASCII value.
  1017. X    -FilTex is only a very simple filter. It therefore passes through
  1018. X     a lot of garbage text strings if you're filtering binary code.
  1019. X     The NULT option improves the performance only slightly because
  1020. X     your average binary code contains a lot of nulls.
  1021. END_OF_FILE
  1022. if test 1787 -ne `wc -c <'FilTex/FilTex.man'`; then
  1023.     echo shar: \"'FilTex/FilTex.man'\" unpacked with wrong size!
  1024. fi
  1025. # end of 'FilTex/FilTex.man'
  1026. fi
  1027. if test -f 'FilTex/FilTex.uu' -a "${1}" != "-c" ; then 
  1028.   echo shar: Will not clobber existing file \"'FilTex/FilTex.uu'\"
  1029. else
  1030. echo shar: Extracting \"'FilTex/FilTex.uu'\" \(1471 characters\)
  1031. sed "s/^X//" >'FilTex/FilTex.uu' <<'END_OF_FILE'
  1032. Xbegin 644 FilTex
  1033. XM```#\P`````````!``````````````#W```#Z0```/=@"DK\```/H`````!.^
  1034. XM5?_8(D]"6;O)9OH[?`!D__8K2/_\*T#_^"QX``1#^@!7<"=.KOW82H!F7D/ZK
  1035. XM`#1.KOW82H!G("Q`3J[_Q"(`9PQ!^@`J)`AV&TZN_]`B3BQX``1.KOYB,"W_3
  1036. XM]DB`3EU.=61O<RYL:6)R87)Y`'EO=2!N965D(&%R<"YL:6)R87)Y`"!6,SDK!
  1037. XM"@`L0#M\`!3_]F$"8+@@;?_\("W_^$/Z`6)%[?_B1_H!/"2)3J[_!"A22H!G%
  1038. XM``$B:P`!'DGZ`9X[?``$_]@@;?_F(`AG&DZN_OYG``$$L+P```/H8@``^CM`.
  1039. XM_]AG``#R(&W_XD/Z`6A.KOWV9@I.KO_**T#_WF`:2?H!<B(M_^(D/````^U.N
  1040. XMKOYT*T#_WF<``,!.KO_$*T#_VDGZ`6L@/```!]%R`$ZN_GI*@&<``*(D0$?Z3
  1041. XM`91X`$GZ`5QZ`#H\`^@B+?_>)`K4A28%3J[_UCP`:P``?&<<?@`>,E``4D53E
  1042. XM1DHS<`!G#!6'0`!21+A\`^AF2KAM_]AE0DJM_^YG!$H'9C@,,@`*0/]G#DJM[
  1043. XM_^IF"!6\``I``%)$2?H!#B(M_]HD"C8$2,-.KO_0MH!F()/)3J[^\BA)2H!FE
  1044. XM%'@`2D9FEKI\`^AF`/]P0FW_]IG,(`QG!B)`3J[_$$YU1FEL92]A+%1(4D53B
  1045. XM2"]K+$Y/3$8O<RQ.54Q4+W,`1FEL5&5X("T@9FEL=&5R(&]U="!N;VXM=&5X0
  1046. XM="X*57-A9V4Z($9I;%1E>"`\1FEL92!\(%-41$E./B!;5$A215-(("-=(%M.1
  1047. XM3TQ&72!;3E5,5%T`4U1$24X`26QL96=A;"!T:')E<VAO;&0@=F%L=64`0V]UF
  1048. XM;&0@;F]T(&]P96X@<V]U<F-E(&9I;&4`3W5T(&]F(&UE;6]R>2$`17)R;W(@U
  1049. XM=VAI;&4@<F5A9&EN9P!%<G)O<B!W:&EL92!W<FET:6YG````5&5X=%1A8CH`P
  1050. XM```````````)"@```````````````````````````"`A(B,D)28G*"DJ*RPMN
  1051. XM+B\P,3(S-#4V-S@Y.CL\/3X_`$%"0T1%1D=(24I+3$U.3U!14E-455976%E:T
  1052. XM6UQ=7E\`86)C9&5F9VAI:FML;6YO<'%R<W1U=G=X>7I[?'U^````````````B
  1053. XM`````````````````````````````````````````````````````````````
  1054. XM`````````````````````````````````````````````````````````````
  1055. XB```````````````````````````````````````````#\@``U
  1056. X``
  1057. Xend
  1058. Xsize 1024
  1059. END_OF_FILE
  1060. if test 1471 -ne `wc -c <'FilTex/FilTex.uu'`; then
  1061.     echo shar: \"'FilTex/FilTex.uu'\" unpacked with wrong size!
  1062. fi
  1063. # end of 'FilTex/FilTex.uu'
  1064. fi
  1065. if test ! -d 'Include' ; then
  1066.     echo shar: Creating directory \"'Include'\"
  1067.     mkdir 'Include'
  1068. fi
  1069. if test -f 'Include/init.i' -a "${1}" != "-c" ; then 
  1070.   echo shar: Will not clobber existing file \"'Include/init.i'\"
  1071. else
  1072. echo shar: Extracting \"'Include/init.i'\" \(3728 characters\)
  1073. sed "s/^X//" >'Include/init.i' <<'END_OF_FILE'
  1074. X; The stuff below is some pretty basic support and initialization, and
  1075. X; should be replaced easily with the includes and macros used in your
  1076. X; assembly system. I don't think you'll encounter many problems when
  1077. X; trying to assemble this.
  1078. X
  1079. X    OPT    A-,M-,O+,O3-,OW-,I+,P+,S-,T+,W+,D-,X-
  1080. X
  1081. X; Define global variable structure pointer
  1082. X
  1083. XGP    EQUR    A5
  1084. X
  1085. X; Equs private to initialization code
  1086. X
  1087. XInitError    EQU    100
  1088. XNormError    EQU    20
  1089. X
  1090. X; Some LVOs & equates (can be gotten by including dos*.i & arpbase.i etc.)
  1091. X
  1092. X_LVOArpAlloc    EQU    -384
  1093. X_LVOArpAllocMem    EQU    -390
  1094. X_LVOArpLock    EQU    -408
  1095. X_LVOArpOpen    EQU    -396
  1096. X_LVOAtol    EQU    -258
  1097. X_LVOCheckAbort    EQU    -270
  1098. X_LVOClose    EQU    -36
  1099. X_LVOCloseDevice    EQU    -450
  1100. X_LVOCloseLibrary EQU    -414
  1101. X_LVODoIO    EQU    -456
  1102. X_LVODelay    EQU    -198
  1103. X_LVODeleteFile    EQU    -72
  1104. X_LVOExamine    EQU    -102
  1105. X_LVOForbid    EQU    -132
  1106. X_LVOFindPort    EQU    -390
  1107. X_LVOFindTask    EQU    -294
  1108. X_LVOGADS    EQU    -252
  1109. X_LVOInput    EQU    -54
  1110. X_LVOLock    EQU    -84
  1111. X_LVOOpen    EQU    -30
  1112. X_LVOOpenDevice    EQU    -444
  1113. X_LVOOpenLibrary    EQU    -552
  1114. X_LVOOpenWorkBench EQU    -210
  1115. X_LVOOutput    EQU    -60
  1116. X_LVOPermit    EQU    -138
  1117. X_LVOPuts    EQU    -240
  1118. X_LVORawDoFmt    EQU    -522
  1119. X_LVORead    EQU    -42
  1120. X_LVOSeek    EQU    -66
  1121. X_LVOSetProtection EQU    -186
  1122. X_LVOStamptoStr    EQU    -564
  1123. X_LVOStrcmp    EQU    -522
  1124. X_LVOUnLock    EQU    -90
  1125. X_LVOWBenchToFront EQU    -342
  1126. X_LVOWrite    EQU    -48
  1127. X
  1128. XACCESS_READ    EQU    -2
  1129. XACCESS_WRITE    EQU    -1
  1130. XArpVersion    EQU    39
  1131. Xds_Days        EQU    0
  1132. Xds_Minute    EQU    4
  1133. Xds_Tick        EQU    8
  1134. Xfib_DateStamp    EQU    $84
  1135. Xfib_SIZEOF    EQU    $104
  1136. XFORMAT_DOS    EQU    0
  1137. XIO_COMMAND    EQU    $1C
  1138. XIOTV_SIZE    EQU    $28
  1139. XIOTV_TIME    EQU    $20
  1140. XLEN_DATSTRING    EQU    10
  1141. XLN_NAME        EQU    $A
  1142. XMEMF_CLEAR    EQU    $10000
  1143. XMEMF_PUBLIC    EQU    1
  1144. XMN_REPLYPORT    EQU    $E
  1145. XMODE_NEWFILE    EQU    $3EE
  1146. XMODE_OLDFILE    EQU    $3ED
  1147. XOFFSET_END    EQU    1
  1148. Xpr_MsgPort    EQU    $5C
  1149. Xpr_WindowPtr    EQU    $B8
  1150. XRESIDENT_MAGIC    EQU    $4AFC
  1151. XThisTask    EQU    $114
  1152. XTR_SETSYSTIME    EQU    $B
  1153. XTV_SECS        EQU    0
  1154. X
  1155. X; Negative structure building macros
  1156. X
  1157. XALIGN    MACRO
  1158. Xsoff    SET    soff-(soff&1)
  1159. X    ENDM
  1160. X
  1161. XSTRUCT    MACRO
  1162. Xsoff    SET    soff-\2
  1163. X    ALIGN
  1164. X\1    EQU    soff
  1165. X    ENDM
  1166. X
  1167. XLONG    MACRO
  1168. X    ALIGN
  1169. Xsoff    SET    soff-4
  1170. X\1    EQU    soff
  1171. X    ENDM
  1172. X
  1173. XWORD    MACRO
  1174. X    ALIGN
  1175. Xsoff    SET    soff-2
  1176. X\1    EQU    soff
  1177. X    ENDM
  1178. X
  1179. XBYTE    MACRO
  1180. Xsoff    SET    soff-1
  1181. X\1    EQU    soff
  1182. X    ENDM
  1183. X
  1184. XSIZE    MACRO
  1185. X    ALIGN
  1186. XStrcSize EQU    soff
  1187. X    ENDM
  1188. X
  1189. X; Define default variables.
  1190. X
  1191. Xsoff    SET    0
  1192. X    LONG    ComLineBase
  1193. X    LONG    ComLineSize
  1194. X    WORD    ReturnCode
  1195. X
  1196. X; This requires A6 to be set properly! Keep track carefully or reload A6
  1197. X
  1198. XCALL    MACRO
  1199. X    JSR    _LVO\1(A6)
  1200. X    ENDM
  1201. X
  1202. X; This tells ARP's shell and resident how large a stack we require.
  1203. X
  1204. XSTACK    MACRO
  1205. X    BRA.S    ResStart
  1206. X    DC.W    RESIDENT_MAGIC
  1207. X    DC.L    \1
  1208. X    DC.L    0
  1209. XResStart:
  1210. X    ENDM
  1211. X
  1212. X; The big one.
  1213. X
  1214. XINIT    MACRO
  1215. X
  1216. X; Setup the stack structure (on stack for reentrability) (GP=A5, do not modify)
  1217. X
  1218. X    LINK    GP,#StrcSize
  1219. X    MOVE.L    SP,A1
  1220. XClearStackStruct:
  1221. X    CLR.W    (A1)+
  1222. X    CMP.L    A1,GP
  1223. X    BNE    ClearStackStruct
  1224. X
  1225. X; Initialize default variables
  1226. X
  1227. X    MOVE.W    #InitError,ReturnCode(GP)
  1228. X    MOVE.L    A0,ComLineBase(GP)
  1229. X    MOVE.L    D0,ComLineSize(GP)
  1230. X
  1231. X; Try to open ARP
  1232. X
  1233. X    MOVE.L    $4.W,A6
  1234. X    LEA    ArpName(PC),A1
  1235. X    MOVEQ    #ArpVersion,D0
  1236. X    CALL    OpenLibrary
  1237. X    TST.L    D0
  1238. X    BNE.S    OpenedOK
  1239. X
  1240. X; Report that the ARP library could not be opened.
  1241. X
  1242. X;    MOVEQ    #0,D0        ; Already 0
  1243. X    LEA    DosName(PC),A1
  1244. X    CALL    OpenLibrary
  1245. X    TST.L    D0
  1246. X    BEQ.S    ThisIsHorrible
  1247. X    MOVE.L    D0,A6
  1248. X    CALL    Output
  1249. X    MOVE.L    D0,D1
  1250. X    BEQ.S    BackToDOS
  1251. X    LEA    LibErr(PC),A0
  1252. X    MOVE.L    A0,D2
  1253. X    MOVEQ    #StringEnd-LibErr,D3
  1254. X    CALL    Write
  1255. X
  1256. X; Return to DOS
  1257. X
  1258. XBackToDOS:
  1259. X    MOVE.L    A6,A1
  1260. X    MOVE.L    $4.W,A6
  1261. X    CALL    CloseLibrary
  1262. XThisIsHorrible:
  1263. X    MOVE.W    ReturnCode(GP),D0
  1264. X    EXT.W    D0
  1265. X    UNLK    GP
  1266. X    RTS
  1267. X
  1268. X; Support strings
  1269. X
  1270. X    IFGE    ArpVersion-100
  1271. X    FAIL "Version > 3 digits"
  1272. X    ENDC
  1273. X
  1274. XTMP      SET    ArpVersion/10
  1275. XDosName      DC.B    'dos.library',0
  1276. XLibErr      DC.B    'you need '
  1277. XArpName      DC.B    'arp.library',0,' V',TMP+'0',(ArpVersion-(TMP*10))+'0','+',10
  1278. XStringEnd:
  1279. X    CNOP    0,2
  1280. X
  1281. X; A6 = ARP base (Do not modify A6 if you use CALL), lower error level, call user.
  1282. X
  1283. XOpenedOK:
  1284. X    MOVE.L    D0,A6
  1285. X    MOVE.W    #NormError,ReturnCode(GP)
  1286. X    BSR.S    UserCode
  1287. X    BRA    BackToDOS
  1288. XUserCode:
  1289. X    ENDM
  1290. END_OF_FILE
  1291. if test 3728 -ne `wc -c <'Include/init.i'`; then
  1292.     echo shar: \"'Include/init.i'\" unpacked with wrong size!
  1293. fi
  1294. # end of 'Include/init.i'
  1295. fi
  1296. if test ! -d 'NoReq' ; then
  1297.     echo shar: Creating directory \"'NoReq'\"
  1298.     mkdir 'NoReq'
  1299. fi
  1300. if test -f 'NoReq/NoReq.asm' -a "${1}" != "-c" ; then 
  1301.   echo shar: Will not clobber existing file \"'NoReq/NoReq.asm'\"
  1302. else
  1303. echo shar: Extracting \"'NoReq/NoReq.asm'\" \(282 characters\)
  1304. sed "s/^X//" >'NoReq/NoReq.asm' <<'END_OF_FILE'
  1305. X
  1306. X    INCLUDE    "/include/init.i"
  1307. X
  1308. X; No sys funcs so no stack needed.
  1309. X
  1310. X    STACK    100
  1311. X
  1312. X; Be done with it
  1313. X
  1314. X    MOVE.L    $4.W,A6
  1315. X    MOVE.L    ThisTask(A6),A0
  1316. X    MOVEQ    #-1,D0
  1317. X    CMP.L    pr_WindowPtr(A0),D0
  1318. X    BNE.S    NotYetInhibited
  1319. X    MOVEQ    #0,D0
  1320. XNotYetInhibited:
  1321. X    MOVE.L    D0,pr_WindowPtr(A0)
  1322. X    MOVEQ    #0,D0
  1323. X    RTS
  1324. X
  1325. X    END
  1326. END_OF_FILE
  1327. if test 282 -ne `wc -c <'NoReq/NoReq.asm'`; then
  1328.     echo shar: \"'NoReq/NoReq.asm'\" unpacked with wrong size!
  1329. fi
  1330. # end of 'NoReq/NoReq.asm'
  1331. fi
  1332. if test -f 'NoReq/NoReq.man' -a "${1}" != "-c" ; then 
  1333.   echo shar: Will not clobber existing file \"'NoReq/NoReq.man'\"
  1334. else
  1335. echo shar: Extracting \"'NoReq/NoReq.man'\" \(669 characters\)
  1336. sed "s/^X//" >'NoReq/NoReq.man' <<'END_OF_FILE'
  1337. X
  1338. XNAME
  1339. X    NoReq - Toggle system requester inhibition.
  1340. X
  1341. X
  1342. XSYNOPSIS
  1343. X    NoReq
  1344. X
  1345. X
  1346. XREQUIREMENTS
  1347. X    None
  1348. X
  1349. X
  1350. XDESCRIPTION
  1351. X    NoReq will set the WindowPtr field of its process to -1, thus
  1352. X    inhibiting the DOS from popping up system requesters if something
  1353. X    goes wrong with a DOS call by the process.
  1354. X    If you repeat this command the field will be switched back to 0.
  1355. X    Since a program inherits its process from the CLI/Shell from which
  1356. X    it was executed, NoReq effectively inhibits requester generation
  1357. X    by subsequent programs executed from the same CLI/Shell.
  1358. X
  1359. X
  1360. XEXAMPLES
  1361. X    Add 'NoReq' to your Remote-Startup to avoid a remote Shell user
  1362. X    causing a requester to pop up, thus causing a deadlock.
  1363. END_OF_FILE
  1364. if test 669 -ne `wc -c <'NoReq/NoReq.man'`; then
  1365.     echo shar: \"'NoReq/NoReq.man'\" unpacked with wrong size!
  1366. fi
  1367. # end of 'NoReq/NoReq.man'
  1368. fi
  1369. if test -f 'NoReq/NoReq.uu' -a "${1}" != "-c" ; then 
  1370.   echo shar: Will not clobber existing file \"'NoReq/NoReq.uu'\"
  1371. else
  1372. echo shar: Extracting \"'NoReq/NoReq.uu'\" \(141 characters\)
  1373. sed "s/^X//" >'NoReq/NoReq.uu' <<'END_OF_FILE'
  1374. Xbegin 644 NoReq
  1375. XM```#\P`````````!```````````````*```#Z0````I@"DK\````9``````LW
  1376. X?>``$(&X!%'#_L*@`N&8"<``A0`"X<`!.=0`````#\@I@A
  1377. X``
  1378. Xend
  1379. Xsize 76
  1380. END_OF_FILE
  1381. if test 141 -ne `wc -c <'NoReq/NoReq.uu'`; then
  1382.     echo shar: \"'NoReq/NoReq.uu'\" unpacked with wrong size!
  1383. fi
  1384. # end of 'NoReq/NoReq.uu'
  1385. fi
  1386. if test ! -d 'PForm' ; then
  1387.     echo shar: Creating directory \"'PForm'\"
  1388.     mkdir 'PForm'
  1389. fi
  1390. if test -f 'PForm/PForm.asm' -a "${1}" != "-c" ; then 
  1391.   echo shar: Will not clobber existing file \"'PForm/PForm.asm'\"
  1392. else
  1393. echo shar: Extracting \"'PForm/PForm.asm'\" \(4230 characters\)
  1394. sed "s/^X//" >'PForm/PForm.asm' <<'END_OF_FILE'
  1395. X; Format input lines to standard output
  1396. X
  1397. X    INCLUDE    "/include/init.i"
  1398. X
  1399. X;    OPT    D+
  1400. X
  1401. X; Local Equs
  1402. X
  1403. XFormatBufSize    EQU    1500
  1404. XMaxLineSize    EQU    512
  1405. XMaxFormatArgs    EQU    20
  1406. X
  1407. X; Variable storage
  1408. X
  1409. X    STRUCT    ArgArray,(1+1)*4
  1410. X    STRUCT    ArgStream,MaxFormatArgs*4
  1411. X    STRUCT    FormatClipInfo,2*4
  1412. X    LONG    StdIn
  1413. X    LONG    StdOut
  1414. X    LONG    FormatBufPtr
  1415. X    SIZE
  1416. X
  1417. X; Regs
  1418. X
  1419. XByteFetch    EQUR    D4
  1420. XReadBytesLeft    EQUR    D5
  1421. XLineBufPtr    EQUR    D6
  1422. XLineBufLeft    EQUR    D7
  1423. XLineEndPtr    EQUR    A2
  1424. XErrorStrPtr    EQUR    A4
  1425. X
  1426. X; Startup
  1427. X
  1428. X    STACK    4000
  1429. X    INIT
  1430. X
  1431. X; Let ARP interpret the commandline
  1432. X
  1433. X    MOVE.L    ComLineBase(GP),A0
  1434. X    MOVE.L    ComLineSize(GP),D0
  1435. X    LEA    HelpMsg(PC),A1
  1436. X    LEA    ArgArray(GP),A2
  1437. X    LEA    Template(PC),A3
  1438. X    MOVE.L    A1,(A2)
  1439. X    CALL    GADS
  1440. X    MOVE.L    (A2),ErrorStrPtr
  1441. X    TST.L    D0
  1442. X    BEQ    ErrorExit
  1443. X    BMI    ErrorExit
  1444. X
  1445. X; Open the standard input & output
  1446. X
  1447. X    CALL    Input
  1448. X    MOVE.L    D0,StdIn(GP)
  1449. X    CALL    Output
  1450. X    MOVE.L    D0,StdOut(GP)
  1451. X
  1452. X; Alloc tracked mem for the string format buffer.
  1453. X
  1454. X    LEA    OutOfMem(PC),ErrorStrPtr
  1455. X    MOVE.L    #FormatBufSize,D0
  1456. X    MOVEQ    #0,D1
  1457. X    CALL    ArpAllocMem
  1458. X    MOVE.L    D0,FormatBufPtr(GP)
  1459. X    BEQ    ErrorExit
  1460. X
  1461. X; Allocate the read-line buffer
  1462. X
  1463. X    MOVE.L    #MaxLineSize+4+MaxLineSize,D0    ; 2 part buf with 0 term space.
  1464. X    MOVEQ    #0,D1
  1465. X    CALL    ArpAllocMem
  1466. X    MOVE.L    D0,LineBufPtr
  1467. X    BEQ    ErrorExit
  1468. X
  1469. X; Initialize the argument stream
  1470. X
  1471. X    MOVEQ    #MaxFormatArgs-1,D0
  1472. X    LEA    ArgStream(GP),A0
  1473. XInitArgStreamLongs:
  1474. X    MOVE.L    LineBufPtr,(A0)+
  1475. X    DBRA    D0,InitArgStreamLongs
  1476. X
  1477. X
  1478. X; ** This is an intelligent ReadLine routine.
  1479. X
  1480. X    MOVEQ    #0,ReadBytesLeft
  1481. X
  1482. X; Reinitialize the line buffer. (First part of dual buffer space)
  1483. X
  1484. XDoForEachLine:
  1485. X    LEA    ReadError(PC),ErrorStrPtr
  1486. X    MOVE.L    LineBufPtr,LineEndPtr
  1487. X    MOVE.L    #MaxLineSize,LineBufLeft
  1488. X
  1489. X; Extract lines from the readbuffer into the line buffer.
  1490. X
  1491. X    BRA.S    ExtractEntry
  1492. XCopyLineBytes:
  1493. X    MOVE.L    ByteFetch,A0
  1494. X    ADDQ.L    #1,ByteFetch
  1495. X    SUBQ.L    #1,ReadBytesLeft
  1496. X    MOVE.B    (A0),D0
  1497. X    CMP.B    #10,D0
  1498. X    BEQ.S    GotLine
  1499. X    MOVE.B    D0,(LineEndPtr)+
  1500. X    SUBQ.L    #1,LineBufLeft
  1501. X    BEQ.S    GotLine
  1502. XExtractEntry:
  1503. X    TST.L    ReadBytesLeft
  1504. X    BNE    CopyLineBytes
  1505. X
  1506. X; Refill the read buffer.
  1507. X
  1508. X    MOVE.L    StdIn(GP),D1
  1509. X    MOVE.L    LineBufPtr,D2
  1510. X    MOVE.L    #MaxLineSize,D3
  1511. X    ADD.L    D3,D2
  1512. X    ADDQ.L    #4,D2
  1513. X    CALL    Read
  1514. X    TST.L    D0
  1515. X    BMI.S    ErrorExit
  1516. X    BNE.S    NotYetDone
  1517. X    CMP.L    LineBufPtr,LineEndPtr
  1518. X    BEQ.S    Exit
  1519. XNotYetDone:
  1520. X    MOVE.L    D2,ByteFetch
  1521. X    MOVE.L    D0,ReadBytesLeft
  1522. X    BNE    CopyLineBytes
  1523. X
  1524. X; Null terminate the line.
  1525. X
  1526. XGotLine:
  1527. X    CLR.B    (LineEndPtr)
  1528. X
  1529. X; Format things, terminate with a LF, and write the format buffer
  1530. X
  1531. X    BSR.S    VanillaDoFmt
  1532. X    MOVE.L    FormatBufPtr(GP),A0
  1533. X    MOVE.B    #10,-1(A0,D0.L)
  1534. X
  1535. X    LEA    WriteError(PC),ErrorStrPtr
  1536. X    MOVE.L    StdOut(GP),D1
  1537. X    MOVE.L    A0,D2
  1538. X    MOVE.L    D0,D3
  1539. X    BEQ.S    WriteDone
  1540. X    CALL    Write
  1541. X    CMP.L    D0,D3
  1542. X    BNE.S    ErrorExit
  1543. XWriteDone:
  1544. X
  1545. X; Check if user hit ^C 
  1546. X
  1547. X    SUB.L    A1,A1
  1548. X    CALL    CheckAbort
  1549. X    MOVE.L    A1,ErrorStrPtr
  1550. X    TST.L    D0
  1551. X    BNE.S    ErrorExit
  1552. X    BRA    DoForEachLine
  1553. X
  1554. X; Done, cleanup
  1555. X
  1556. XExit:
  1557. X    CLR.W    ReturnCode(GP)
  1558. X    SUB.L    ErrorStrPtr,ErrorStrPtr
  1559. XErrorExit:
  1560. X
  1561. X; Display error string, if any, and exit
  1562. X
  1563. X    MOVE.L    ErrorStrPtr,D0
  1564. X    BEQ.S    NoErrorMsg
  1565. X    MOVE.L    D0,A1
  1566. X    CALL    Puts
  1567. XNoErrorMsg:
  1568. X    RTS
  1569. X
  1570. X; Subroutines
  1571. X
  1572. X; This sub uses exec's RawDoFmt to do string formatting while clipping
  1573. X; any surplus data to fit the buffer size. Arps format routines have
  1574. X; no overflow checks, and since the user is not guaranteed to act
  1575. X; sanely, clipping is essential.
  1576. X; I : Assumes a valid format string and buffer
  1577. X; O : The format buffer contain the formatted string.
  1578. X;   : D0.L = Size of formatted string.
  1579. X
  1580. XVanilla_Regs    REG    A2/A3/A6
  1581. X
  1582. XVanillaDoFmt:
  1583. X    MOVEM.L    Vanilla_Regs,-(SP)
  1584. X    MOVE.L    ArgArray(GP),A0
  1585. X    LEA    ArgStream(GP),A1
  1586. X    LEA    DoClippedBufferFill(PC),A2
  1587. X    LEA    FormatClipInfo(GP),A3
  1588. X    MOVE.L    FormatBufPtr(GP),(A3)
  1589. X    MOVE.L    (A3),4(A3)
  1590. X    ADD.L    #FormatBufSize,4(A3)
  1591. X    MOVE.L    $4.W,A6                ; exec
  1592. X    CALL    RawDoFmt
  1593. X    MOVE.L    (A3),D0
  1594. X    SUB.L    FormatBufPtr(GP),D0
  1595. X    MOVEM.L    (SP)+,Vanilla_Regs
  1596. X    RTS
  1597. X
  1598. X; Assumes A0 is usable, not clear from autodocs whether this is true.
  1599. X; (Default calling conventions and ROM code suggest it is)
  1600. X
  1601. XDoClippedBufferFill:
  1602. X    MOVE.L    (A3)+,A0
  1603. X    CMP.L    (A3),A0
  1604. X    BNE.S    NotYetAtBufEnd
  1605. X    SUBQ.L    #1,A0
  1606. XNotYetAtBufEnd:
  1607. X    MOVE.B    D0,(A0)+
  1608. X    MOVE.L    A0,-(A3)
  1609. X    RTS
  1610. X
  1611. X; The string section
  1612. X
  1613. XTemplate:
  1614. X    DC.B    'FormatString/a',0
  1615. XHelpMsg:
  1616. X    DC.B    'PForm - Pipe formatted lines.',10
  1617. X    DC.B    'Usage: PForm "prefix %[width.limit]s postfix"',0
  1618. XOutOfMem:
  1619. X    DC.B    'Out of memory!',0
  1620. XReadError:
  1621. X    DC.B    'Error while reading',0
  1622. XWriteError:
  1623. X    DC.B    'Error while writing',0
  1624. X    CNOP    0,2
  1625. X
  1626. X    END
  1627. END_OF_FILE
  1628. if test 4230 -ne `wc -c <'PForm/PForm.asm'`; then
  1629.     echo shar: \"'PForm/PForm.asm'\" unpacked with wrong size!
  1630. fi
  1631. # end of 'PForm/PForm.asm'
  1632. fi
  1633. if test -f 'PForm/PForm.man' -a "${1}" != "-c" ; then 
  1634.   echo shar: Will not clobber existing file \"'PForm/PForm.man'\"
  1635. else
  1636. echo shar: Extracting \"'PForm/PForm.man'\" \(1442 characters\)
  1637. sed "s/^X//" >'PForm/PForm.man' <<'END_OF_FILE'
  1638. X
  1639. XNAME
  1640. X    PForm - Pipe formatted lines.
  1641. X
  1642. X
  1643. XSYNOPSIS
  1644. X    PForm "prefix %[flags][width.limit]s postfix"
  1645. X
  1646. X
  1647. XREQUIREMENTS
  1648. X    The ARP library
  1649. X
  1650. X
  1651. XDESCRIPTION
  1652. X    PForm reads lines from the standard input, formats them to your
  1653. X    specifications, and writes them to the standard output.
  1654. X    The formatting is done using exec's DoRawFmt. This is C like string
  1655. X    formatting. See programmer manuals for additional information.
  1656. X    What matters here is that PForm outputs its argument line string
  1657. X    for every input line, and it replaces every occurrence of %s in the
  1658. X    argument line string with the current input line.
  1659. X    The "width" argument specifies the fieldsize used when inserting the
  1660. X    input line into the string, and "limit" specifies the maximum number
  1661. X    of characters copied from the input line while inserting.
  1662. X    The only valid flag is "-" which specifies left justification.
  1663. X    You may use %s upto 20 times in a single format string.
  1664. X    To get a single "%" use "%%".
  1665. X    The main use for PForm lies in reformatting the output of commands.
  1666. X
  1667. X
  1668. XEXAMPLES
  1669. X    Alias Kill Status \| Search STDIN [] NONUM \| PForm "Break%11.10s" \| Execute
  1670. X    This alias will break the process with the name you specify. You
  1671. X    no longer need to specify the process number.
  1672. X
  1673. X    List [] NOHEAD QUICK | PForm "Rename %s %s.old" | Execute
  1674. X    Give commands wildcarding properties.
  1675. X
  1676. X
  1677. XBUGS/LIMITATIONS
  1678. X    How to apply PForm to the output of a command depends on the specific
  1679. X    format of its output. You'd better experiment.
  1680. END_OF_FILE
  1681. if test 1442 -ne `wc -c <'PForm/PForm.man'`; then
  1682.     echo shar: \"'PForm/PForm.man'\" unpacked with wrong size!
  1683. fi
  1684. # end of 'PForm/PForm.man'
  1685. fi
  1686. if test -f 'PForm/PForm.uu' -a "${1}" != "-c" ; then 
  1687.   echo shar: Will not clobber existing file \"'PForm/PForm.uu'\"
  1688. else
  1689. echo shar: Extracting \"'PForm/PForm.uu'\" \(969 characters\)
  1690. sed "s/^X//" >'PForm/PForm.uu' <<'END_OF_FILE'
  1691. Xbegin 644 PForm
  1692. XM```#\P`````````!``````````````">```#Z0```)Y@"DK\```/H`````!.,
  1693. XM5?^*(D]"6;O)9OH[?`!D__8K2/_\*T#_^"QX``1#^@!7<"=.KOW82H!F7D/Z=
  1694. XM`#1.KOW82H!G("Q`3J[_Q"(`9PQ!^@`J)`AV&TZN_]`B3BQX``1.KOYB,"W_3
  1695. XM]DB`3EU.=61O<RYL:6)R87)Y`'EO=2!N965D(&%R<"YL:6)R87)Y`"!6,SDK!
  1696. XM"@`L0#M\`!3_]F$"8+@@;?_\("W_^$/Z`4=%[?_N1_H!,"2)3J[_!"A22H!GJ
  1697. XM``#0:P``S$ZN_\HK0/^23J[_Q"M`_XY)^@%E(#P```7<<@!.KOYZ*T#_BF<`F
  1698. XM`*0@/```!`1R`$ZN_GHL`&<``))P$T'M_YX@QE'(__QZ`$GZ`3PD1BX\```"K
  1699. XM`&`4($12A%.%$!"P/``*9RX4P%.'9RA*A6;H(BW_DB0&)CP```(`U(-8@DZNF
  1700. XM_]9*@&M$9@2UQF<X*`(J`&;$0A)A0"!M_XH1O``*"/])^@#X(BW_CB0()@!G)
  1701. XM"$ZN_]"V@&84D\E.KO[R*$E*@&8(8(1";?_VF<P@#&<&(D!.KO\03G5(YP`R+
  1702. XM(&W_[D/M_YY%^@`J1^W_EB:M_XHG4P`$!JL```7<``0L>``$3J[]]B`3D*W_O
  1703. XMBDS?3`!.=2!;L=-F`E.($,`G"$YU1F]R;6%T4W1R:6YG+V$`4$9O<FT@+2!09
  1704. XM:7!E(&9O<FUA='1E9"!L:6YE<RX*57-A9V4Z(%!&;W)M(")P<F5F:7@@)5MWQ
  1705. XM:61T:"YL:6UI=%US('!O<W1F:7@B`$]U="!O9B!M96UO<GDA`$5R<F]R('=HE
  1706. XF:6QE(')E861I;F<`17)R;W(@=VAI;&4@=W)I=&EN9P```````_)R"
  1707. X``
  1708. Xend
  1709. Xsize 668
  1710. END_OF_FILE
  1711. if test 969 -ne `wc -c <'PForm/PForm.uu'`; then
  1712.     echo shar: \"'PForm/PForm.uu'\" unpacked with wrong size!
  1713. fi
  1714. # end of 'PForm/PForm.uu'
  1715. fi
  1716. if test -f 'ReadMe' -a "${1}" != "-c" ; then 
  1717.   echo shar: Will not clobber existing file \"'ReadMe'\"
  1718. else
  1719. echo shar: Extracting \"'ReadMe'\" \(1939 characters\)
  1720. sed "s/^X//" >'ReadMe' <<'END_OF_FILE'
  1721. X
  1722. X              Tiny Tools  V1.0
  1723. X              ================
  1724. X
  1725. X
  1726. XThis archive contains a set of tools/commands. All are tiny and can be made
  1727. Xresident. Use the "ExecMe" batchfile to fix the pure flags. Most tools
  1728. Xrequire the ARP library.
  1729. X
  1730. X
  1731. XHere's a list;
  1732. X
  1733. XCheckList - Check for the presence of an item in a system list.
  1734. XClip       - Pipe through clipped lines.
  1735. XFilTex      - Filter out non-text bytes.
  1736. XNoReq      - Disable system requesters (toggle).
  1737. XPForm      - Pipe through formatted lines.
  1738. XTee      - Split pipe stream.
  1739. XWBTF      - WorkBench to front.
  1740. X
  1741. X
  1742. XEach tool's directory contains an executable, manual and assembly source.
  1743. X
  1744. XAll executables contain a "resident program tag" with a stack size setting
  1745. Xthat overrides your shell's default setting, assuming it uses ARP for
  1746. Xlaunching programs. This helps you conserve memory. None of the tools
  1747. Xrequire more than 4000 bytes stack, so if you don't use an ARP driven shell
  1748. Xyou'll still be safe.
  1749. X
  1750. XMost of these tools are building blocks for making aliases or batchfiles.
  1751. XUse your imagination and you'll surely find some novel ways in which to
  1752. Xapply them to enhance your system. Don't limit yourself to the scope of
  1753. Xthe examples.
  1754. XSome examples given in the manuals assume an ARP/ASH/PIP: environment. If
  1755. Xyour shell has no in-line piping facility, you'll have to use redirection
  1756. Xin order to make use of Clip, PForm and Tee.
  1757. X
  1758. XThe source code requires the init.i file in the include directory. No other
  1759. Xinclude files are needed in order to assemble. I've written these tools in
  1760. Xassembly because I love the snappy way in which my ARP system operates by
  1761. Xvirtue of a lot of tools being resident, and I don't want to waste a lot of
  1762. Xmemory.
  1763. X
  1764. XYou may apply, modify or distribute the source and tools as you see fit.
  1765. XPreferably keep this archive in its original state though.
  1766. X
  1767. XDirect ideas for new tools or any bug reports to:
  1768. X
  1769. XUUCP: hp4nl!neabbs!ajbrouw
  1770. X
  1771. Xor
  1772. X
  1773. XAlbert-Jan Brouwer
  1774. XSt-Eustatiusstr. 2
  1775. X2612 HA   Delft
  1776. XThe Netherlands
  1777. X
  1778. XEnjoy
  1779. END_OF_FILE
  1780. if test 1939 -ne `wc -c <'ReadMe'`; then
  1781.     echo shar: \"'ReadMe'\" unpacked with wrong size!
  1782. fi
  1783. # end of 'ReadMe'
  1784. fi
  1785. if test ! -d 'Tee' ; then
  1786.     echo shar: Creating directory \"'Tee'\"
  1787.     mkdir 'Tee'
  1788. fi
  1789. if test -f 'Tee/Tee.asm' -a "${1}" != "-c" ; then 
  1790.   echo shar: Will not clobber existing file \"'Tee/Tee.asm'\"
  1791. else
  1792. echo shar: Extracting \"'Tee/Tee.asm'\" \(3530 characters\)
  1793. sed "s/^X//" >'Tee/Tee.asm' <<'END_OF_FILE'
  1794. X; Tee, split stdinput to stdoutput and multiple file streams.
  1795. X
  1796. X    INCLUDE    "/include/init.i"
  1797. X
  1798. X; Local Equs
  1799. X
  1800. XBufSize        EQU    512
  1801. XHandles        EQU    BufSize
  1802. X
  1803. X; Variable storage
  1804. X
  1805. X    STRUCT    ArgArray,(2+1)*4        ; +1 'cause I'm parnoid
  1806. X    SIZE
  1807. X
  1808. X; Regs
  1809. X
  1810. XAppendBool    EQUR    D4
  1811. XStdInput    EQUR    D5
  1812. XAllocStruct    EQUR    D6
  1813. XActualLength    EQUR    D7
  1814. X
  1815. XFileNamePtrPtr    EQUR    A2
  1816. XHandlePtr    EQUR    A3
  1817. XErrorStrPtr    EQUR    A4
  1818. X
  1819. X; Start
  1820. X
  1821. X    STACK    4000
  1822. X    INIT
  1823. X
  1824. X; Let ARP interpret the commandline
  1825. X
  1826. X    MOVE.L    ComLineBase(GP),A0
  1827. X    MOVE.L    ComLineSize(GP),D0
  1828. X    LEA    HelpMsg(PC),A1
  1829. X    LEA    ArgArray(GP),A2
  1830. X    LEA    Template(PC),A3
  1831. X    MOVE.L    A1,(A2)
  1832. X    CALL    GADS
  1833. X    TST.L    D0
  1834. X    BEQ.S    UnusableArgs
  1835. X    BPL.S    ArgsMightBeOK
  1836. XUnusableArgs:
  1837. X    MOVE.L    (A2),ErrorStrPtr
  1838. X    BRA    ErrorExit
  1839. XArgsMightBeOK:
  1840. X
  1841. X; Fetch the -a switch and check if at least one file present.
  1842. X
  1843. X    MOVE.L    4(A2),AppendBool
  1844. X    BEQ.S    ArgsOK
  1845. X    LEA    HelpMsg(PC),ErrorStrPtr
  1846. X    MOVEQ    #1,D1
  1847. X    CMP.L    D0,D1
  1848. X    BEQ    ErrorExit
  1849. XArgsOK:
  1850. X
  1851. X; Alloc tracked mem for the read write buf and the handles.
  1852. X
  1853. X    LEA    OutOfMem(PC),ErrorStrPtr
  1854. X    ADDQ.L    #1+1,D0            ; Make space for StdOut + null termination
  1855. X    LSL.L    #2,D0            ; in the file handles longword array.
  1856. X    ADD.L    #BufSize,D0        ; Buffer and Handles use same mem allocation
  1857. X    MOVEQ    #0,D1
  1858. X    CALL    ArpAllocMem
  1859. X    MOVE.L    D0,AllocStruct        ; Data reg, so Z gets set
  1860. X    BEQ    ErrorExit
  1861. X
  1862. X; Initialize the handle and filename longword array pointers
  1863. X
  1864. X    MOVE.L    ArgArray(GP),FileNamePtrPtr
  1865. X    MOVE.L    AllocStruct,A0
  1866. X    LEA    Handles(A0),HandlePtr
  1867. X
  1868. X; Open the standard input and output
  1869. X
  1870. X    CALL    Input
  1871. X    MOVE.L    D0,StdInput
  1872. X    CALL    Output
  1873. X    MOVE.L    D0,(HandlePtr)+
  1874. X
  1875. X
  1876. X;-----    The open the files, and seek to end loop
  1877. X
  1878. X    LEA    OpenError(PC),ErrorStrPtr
  1879. XOpenNextFile:
  1880. X    TST.L    (FileNamePtrPtr)
  1881. X    BEQ.S    AllFilesOpened
  1882. X
  1883. X; If Appending, try to open (tracked) the file as an old file
  1884. X
  1885. X    TST.L    AppendBool
  1886. X    BEQ.S    NoAppendingRequested
  1887. X    MOVE.L    (FileNamePtrPtr),D1
  1888. X    MOVE.L    #MODE_OLDFILE,D2
  1889. X    CALL    ArpOpen
  1890. X    MOVE.L    D0,(HandlePtr)
  1891. X    BEQ.S    TryToOpenNewFile
  1892. X
  1893. X; Seek to the end
  1894. X
  1895. X    MOVE.L    D0,D1
  1896. X    MOVEQ    #0,D2
  1897. X    MOVE.L    #OFFSET_END,D3
  1898. X    CALL    Seek
  1899. X    ADDQ.L    #1,D0
  1900. X    BEQ    ErrorExit
  1901. X    BRA.S    IncrementAndLoop
  1902. XNoAppendingRequested:
  1903. X
  1904. X; Open files (tracked) as new
  1905. X
  1906. XTryToOpenNewFile:
  1907. X    MOVE.L    (FileNamePtrPtr),D1
  1908. X    MOVE.L    #MODE_NEWFILE,D2
  1909. X    CALL    ArpOpen
  1910. X    MOVE.L    D0,(HandlePtr)
  1911. X    BEQ    ErrorExit
  1912. X
  1913. X; Update pointers and loop back
  1914. X
  1915. XIncrementAndLoop:
  1916. X    ADDQ.L    #4,FileNamePtrPtr
  1917. X    ADDQ.L    #4,HandlePtr
  1918. X    BRA    OpenNextFile
  1919. XAllFilesOpened:
  1920. X    CLR.L    (HandlePtr)                ; Null termination
  1921. X
  1922. X
  1923. X;-----    The single input multi output copy loop, check for ^C & initize
  1924. X
  1925. XDoNextRdWrChunk:
  1926. X    SUB.L    A1,A1
  1927. X    CALL    CheckAbort
  1928. X    MOVE.L    A1,ErrorStrPtr
  1929. X    TST.L    D0
  1930. X    BNE.S    ErrorExit
  1931. X
  1932. X    LEA    WriteError(PC),ErrorStrPtr
  1933. X    MOVE.L    AllocStruct,A0
  1934. X    LEA    Handles(A0),HandlePtr            ; Reset to start of array
  1935. X
  1936. X; Read from the standard input until EOF or error
  1937. X
  1938. X    MOVE.L    StdInput,D1
  1939. X    MOVE.L    AllocStruct,D2
  1940. X    MOVE.L    #BufSize,D3
  1941. X    CALL    Read
  1942. X    MOVE.L    D0,ActualLength
  1943. X    BEQ.S    Exit
  1944. X    BMI.S    ErrorExit
  1945. X
  1946. X; Do the multiwrite, and loop back
  1947. X
  1948. XDoNextWrite:
  1949. X    MOVE.L    (HandlePtr)+,D1
  1950. X    BEQ    DoNextRdWrChunk
  1951. X    MOVE.L    AllocStruct,D2
  1952. X    MOVE.L    ActualLength,D3
  1953. X    CALL    Write
  1954. X    CMP.L    D0,D3
  1955. X    BNE.S    ErrorExit
  1956. X    BRA    DoNextWrite
  1957. X
  1958. X
  1959. X; Done, cleanup
  1960. X
  1961. XExit:
  1962. X    CLR.W    ReturnCode(GP)
  1963. X    SUB.L    ErrorStrPtr,ErrorStrPtr
  1964. XErrorExit:
  1965. X
  1966. X; Display error string, if any, and exit
  1967. X
  1968. X    MOVE.L    ErrorStrPtr,D0
  1969. X    BEQ.S    NoErrorMsg
  1970. X    MOVE.L    D0,A1
  1971. X    CALL    Puts
  1972. XNoErrorMsg:
  1973. X    RTS
  1974. X
  1975. X; The string section
  1976. X
  1977. XTemplate:
  1978. X    DC.B    'Files/...,-a=APPEND/s',0
  1979. XHelpMsg:
  1980. X    DC.B    'Tee - pipe fitting.',10
  1981. X    DC.B    'Usage: Tee [-a] <File> [...]',0
  1982. XOutOfMem:
  1983. X    DC.B    'Out of memory!',0
  1984. XOpenError:
  1985. X    DC.B    'Tee-file could not be opened',10
  1986. XWriteError:
  1987. X    DC.B    'Error while writing to tee-file',0
  1988. X    CNOP    0,2
  1989. X
  1990. X    END
  1991. END_OF_FILE
  1992. if test 3530 -ne `wc -c <'Tee/Tee.asm'`; then
  1993.     echo shar: \"'Tee/Tee.asm'\" unpacked with wrong size!
  1994. fi
  1995. # end of 'Tee/Tee.asm'
  1996. fi
  1997. if test -f 'Tee/Tee.man' -a "${1}" != "-c" ; then 
  1998.   echo shar: Will not clobber existing file \"'Tee/Tee.man'\"
  1999. else
  2000. echo shar: Extracting \"'Tee/Tee.man'\" \(1374 characters\)
  2001. sed "s/^X//" >'Tee/Tee.man' <<'END_OF_FILE'
  2002. X
  2003. XNAME
  2004. X    Tee - pipe fitting
  2005. X
  2006. X
  2007. XSYNOPSIS
  2008. X    Tee [-a | APPEND] <File> [...]
  2009. X
  2010. X
  2011. XREQUIREMENTS
  2012. X    The ARP library
  2013. X
  2014. X
  2015. XDESCRIPTION
  2016. X    Tee copies the standard input to the standard output while making
  2017. X    copies of it into one or more files. The -a or APPEND switch makes
  2018. X    Tee append to old files instead of creating new files. If a target
  2019. X    file does not exist, and -a has been selected, it will be created.
  2020. X
  2021. X
  2022. XEXAMPLES
  2023. X    prompt> Tee T:keys | QueryingTool
  2024. X    prompt> QueryingTool <T:keys | Tee T:log
  2025. X    This saves keystrokes destined for a CLI tool to a file, and
  2026. X    reuses them whilst making a reference copy of the output.
  2027. X
  2028. X
  2029. XBUGS/LIMITATIONS
  2030. X    -Use the end-of-file control key specific to your shell to terminate
  2031. X     if you run Tee as the first part of your pipe-command line.
  2032. X    -Tee was modelled after one of the Unix-alike utilities distributed
  2033. X     in a uusenet posting by David Gay. Tiny-Tee's functionality differs
  2034. X     from that version in 3 ways:
  2035. X     1. The -a switch can be substituted by an equivalent switch, namely
  2036. X        'APPEND'.
  2037. X     2. The ARP template needs switches to be specified after multiargs,
  2038. X        still you may place the -a switch anywhere in the command line,
  2039. X        thus it is up to you to preserve the Unix syntax (-a in front).
  2040. X     3. David's Tee version does not seem to want to process non-ascii
  2041. X        byte streams (this might be as intended). Tiny-Tee copies every
  2042. X        byte you feed into it.
  2043. END_OF_FILE
  2044. if test 1374 -ne `wc -c <'Tee/Tee.man'`; then
  2045.     echo shar: \"'Tee/Tee.man'\" unpacked with wrong size!
  2046. fi
  2047. # end of 'Tee/Tee.man'
  2048. fi
  2049. if test -f 'Tee/Tee.uu' -a "${1}" != "-c" ; then 
  2050.   echo shar: Will not clobber existing file \"'Tee/Tee.uu'\"
  2051. else
  2052. echo shar: Extracting \"'Tee/Tee.uu'\" \(872 characters\)
  2053. sed "s/^X//" >'Tee/Tee.uu' <<'END_OF_FILE'
  2054. Xbegin 644 Tee
  2055. XM```#\P`````````!``````````````"-```#Z0```(U@"DK\```/H`````!.J
  2056. XM5?_J(D]"6;O)9OH[?`!D__8K2/_\*T#_^"QX``1#^@!7<"=.KOW82H!F7D/Z]
  2057. XM`#1.KOW82H!G("Q`3J[_Q"(`9PQ!^@`J)`AV&TZN_]`B3BQX``1.KOYB,"W_3
  2058. XM]DB`3EU.=61O<RYL:6)R87)Y`'EO=2!N965D(&%R<"YL:6)R87)Y`"!6,SDK!
  2059. XM"@`L0#M\`!3_]F$"8+@@;?_\("W_^$/Z`0I%[?_J1_H`["2)3J[_!$J`9P)J6
  2060. XM!BA28```SB@J``1G#$GZ`.9R`;*`9P``O$GZ`0M4@.6(!H````(`<@!.KOYZF
  2061. XM+`!G``"B)&W_ZB!&1^@"`$ZN_\HJ`$ZN_\0FP$GZ`.I*DF<^2H1G(B(2)#P`S
  2062. XM``/M3J[^=":`9Q(B`'0`=@%.KO^^4H!G``!@8!(B$B0\```#[DZN_G0F@&<`.
  2063. XM`$Q8BEB+8+Y"DY/)3J[^\BA)2H!F-DGZ`+,@1D?H`@`B!20&)CP```(`3J[_@
  2064. XMUBX`9Q1K&"(;9](D!B8'3J[_T+:`9@A@[D)M__:9S"`,9P8B0$ZN_Q!.=49I-
  2065. XM;&5S+RXN+BPM83U!4%!%3D0O<P!4964@+2!P:7!E(&9I='1I;F<N"E5S86=E)
  2066. XM.B!4964@6RUA72`\1FEL93X@6RXN+ET`3W5T(&]F(&UE;6]R>2$`5&5E+69I[
  2067. XM;&4@8V]U;&0@;F]T(&)E(&]P96YE9`I%<G)O<B!W:&EL92!W<FET:6YG('1OO
  2068. X/('1E92UF:6QE``````/R@
  2069. X``
  2070. Xend
  2071. Xsize 600
  2072. END_OF_FILE
  2073. if test 872 -ne `wc -c <'Tee/Tee.uu'`; then
  2074.     echo shar: \"'Tee/Tee.uu'\" unpacked with wrong size!
  2075. fi
  2076. # end of 'Tee/Tee.uu'
  2077. fi
  2078. if test ! -d 'WBTF' ; then
  2079.     echo shar: Creating directory \"'WBTF'\"
  2080.     mkdir 'WBTF'
  2081. fi
  2082. if test -f 'WBTF/WBTF.asm' -a "${1}" != "-c" ; then 
  2083.   echo shar: Will not clobber existing file \"'WBTF/WBTF.asm'\"
  2084. else
  2085. echo shar: Extracting \"'WBTF/WBTF.asm'\" \(799 characters\)
  2086. sed "s/^X//" >'WBTF/WBTF.asm' <<'END_OF_FILE'
  2087. X
  2088. X; A few equs and equrs.
  2089. X
  2090. XKickVerNum    EQU    31 ; >= Kick 1.1
  2091. XFatal    EQU    20
  2092. XWarn    EQU    5
  2093. XOK    EQU    0
  2094. X
  2095. XRETURN    EQUR    D2
  2096. X
  2097. X    INCLUDE    "/include/init.i"
  2098. X
  2099. X; I suppose this is more than sufficient stack for intuition.
  2100. X
  2101. X    STACK    2000
  2102. X
  2103. X; Open the intuition library
  2104. X
  2105. X    MOVEQ    #Fatal,RETURN
  2106. X    MOVEQ    #KickVerNum,D0
  2107. X    LEA    IntuitionName(PC),A1
  2108. X    MOVE.L    $4.W,A6
  2109. X    CALL    OpenLibrary
  2110. X    TST.L    D0
  2111. X    BEQ.S    FatalExit
  2112. X
  2113. X; Request that the workbench be sent to front
  2114. X
  2115. X    MOVEQ    #Warn,RETURN
  2116. X    MOVE.L    D0,A6
  2117. X    CALL    WBenchToFront
  2118. X    TST.B    D0
  2119. X    BNE.S    Exit
  2120. X
  2121. X; Workbench closed, ask for the workbench to be opened
  2122. X
  2123. X    CALL    OpenWorkBench
  2124. X    TST.L    D0
  2125. X    BEQ.S    WarnExit
  2126. X
  2127. X; Cleanup
  2128. X
  2129. XExit:
  2130. X    MOVEQ    #OK,RETURN
  2131. XWarnExit:
  2132. X    MOVE.L    A6,A1
  2133. X    MOVE.L    $4.W,A6
  2134. X    CALL    CloseLibrary
  2135. XFatalExit:
  2136. X    MOVE.L    RETURN,D0
  2137. X    RTS
  2138. X
  2139. X; Strings
  2140. X
  2141. XIntuitionName:
  2142. X    DC.B    'intuition.library',0
  2143. X    CNOP    0,2
  2144. X
  2145. X    END
  2146. END_OF_FILE
  2147. if test 799 -ne `wc -c <'WBTF/WBTF.asm'`; then
  2148.     echo shar: \"'WBTF/WBTF.asm'\" unpacked with wrong size!
  2149. fi
  2150. # end of 'WBTF/WBTF.asm'
  2151. fi
  2152. if test -f 'WBTF/WBTF.man' -a "${1}" != "-c" ; then 
  2153.   echo shar: Will not clobber existing file \"'WBTF/WBTF.man'\"
  2154. else
  2155. echo shar: Extracting \"'WBTF/WBTF.man'\" \(735 characters\)
  2156. sed "s/^X//" >'WBTF/WBTF.man' <<'END_OF_FILE'
  2157. X
  2158. XNAME
  2159. X    WBTF - switch Workbench to front
  2160. X
  2161. X
  2162. XSYNOPSIS
  2163. X    WBTF
  2164. X
  2165. X
  2166. XREQUIREMENTS
  2167. X    none
  2168. X
  2169. X
  2170. XDESCRIPTION
  2171. X    WBTF tries to switch the WorkBench screen to the front. If it
  2172. X    fails, because the WBscreen has been closed by some program,
  2173. X    it will try to reopen the WorkBench.
  2174. X    WBTF returns returncode 0 when it succeeds, and returncode
  2175. X    5 when the WorkBench could not be reopened.
  2176. X
  2177. X
  2178. XEXAMPLES
  2179. X    Place WBTF in your 'Shell-Startup' script. If you use a hot-key
  2180. X    utility like DMouse, the WorkBench screen should pop upfront
  2181. X    whenever you hot-key-open a shell.
  2182. X
  2183. X
  2184. XBUGS/LIMITATIONS
  2185. X    The WorkBench reopen feature is not very useful in the context
  2186. X    given by the example; For the Shell-Startup to execute, a shell
  2187. X    window, and therefore the WBscreen, has to be open.
  2188. END_OF_FILE
  2189. if test 735 -ne `wc -c <'WBTF/WBTF.man'`; then
  2190.     echo shar: \"'WBTF/WBTF.man'\" unpacked with wrong size!
  2191. fi
  2192. # end of 'WBTF/WBTF.man'
  2193. fi
  2194. if test -f 'WBTF/WBTF.uu' -a "${1}" != "-c" ; then 
  2195.   echo shar: Will not clobber existing file \"'WBTF/WBTF.uu'\"
  2196. else
  2197. echo shar: Extracting \"'WBTF/WBTF.uu'\" \(208 characters\)
  2198. sed "s/^X//" >'WBTF/WBTF.uu' <<'END_OF_FILE'
  2199. Xbegin 644 WBTF
  2200. XM```#\P`````````!```````````````6```#Z0```!9@"DK\```'T`````!T*
  2201. XM%'`?0_H`,BQX``1.KOW82H!G('0%+$!.KOZJ2@!F"$ZN_RY*@&<"=``B3BQX!
  2202. XB``1.KOYB(`).=6EN='5I=&EO;BYL:6)R87)Y```````#\BY*X
  2203. X``
  2204. Xend
  2205. Xsize 124
  2206. END_OF_FILE
  2207. if test 208 -ne `wc -c <'WBTF/WBTF.uu'`; then
  2208.     echo shar: \"'WBTF/WBTF.uu'\" unpacked with wrong size!
  2209. fi
  2210. # end of 'WBTF/WBTF.uu'
  2211. fi
  2212. echo shar: End of archive 1 \(of 1\).
  2213. cp /dev/null ark1isdone
  2214. MISSING=""
  2215. for I in 1 ; do
  2216.     if test ! -f ark${I}isdone ; then
  2217.     MISSING="${MISSING} ${I}"
  2218.     fi
  2219. done
  2220. if test "${MISSING}" = "" ; then
  2221.     echo You have the archive.
  2222.     rm -f ark[1-9]isdone
  2223. else
  2224.     echo You still need to unpack the following archives:
  2225.     echo "        " ${MISSING}
  2226. fi
  2227. ##  End of shell archive.
  2228. exit 0
  2229. -- 
  2230. Mail submissions (sources or binaries) to <amiga@uunet.uu.net>.
  2231. Mail comments to the moderator at <amiga-request@uunet.uu.net>.
  2232. Post requests for sources, and general discussion to comp.sys.amiga.
  2233.